+ Reply to Thread
Results 1 to 11 of 11

Copy Merged Cell and Paste to Right "X" times

  1. #1
    Registered User
    Join Date
    04-23-2013
    Location
    TX, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Copy Merged Cell and Paste to Right "X" times

    Hi I am new to forum (and programming) so forgive me if don't explain well......

    I am looking to copy a merged cell "F1:F7" and paste to right "X" times based on the value of a cell on another sheet (newcolumns = Range("q" & x).Value). I want to keep formatting especially width.

    Any help would be greatly appreciated.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy Merged Cell and Paste to Right "X" times

    You can PasteSpecial Column Widths but I don't get what you actually want???
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    04-23-2013
    Location
    TX, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copy Merged Cell and Paste to Right "X" times

    I am working on a spreadsheet for production planning. I an taking the time for individual parts in production and scaling it in a merged cell on a worksheet. The problem I am having is the size of some cell widths exceed the maximum width and I have to splint the cell up. So I have created the exception to split the cell if it is over a certain size but I can not figure out how to take the new cell width and copy it the number of times specified.

    Hope that is somewhat clearer. Below is the code I have so far, the splitting of the cells it happening in the Excel Cell and not the macro.


    HTML Code: 

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy Merged Cell and Paste to Right "X" times

    Hey JDOhio,

    Why not just autofit the columns after the processing???

  5. #5
    Registered User
    Join Date
    04-23-2013
    Location
    TX, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copy Merged Cell and Paste to Right "X" times

    I don't believe auto fit will work because the width of the cell is not related to the information in the cell rather the dimension in inches I call out.

    Am I thinking of this incorrectly?

    Thanks.

  6. #6
    Registered User
    Join Date
    04-23-2013
    Location
    TX, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copy Merged Cell and Paste to Right "X" times

    Attached is the file I am working from. When you select make it will make the cards called out in C1 & D1 with the cell being the width required. The records that are using newinches (column "p")(where inches ("m") is >16.5) I need the cell to be copied a number of times based on the value newcolumns ("o").

    Thanks.
    Attached Files Attached Files

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy Merged Cell and Paste to Right "X" times

    The formulas in your sample aren't working - I'll look again tomorrow

  8. #8
    Registered User
    Join Date
    04-23-2013
    Location
    TX, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copy Merged Cell and Paste to Right "X" times

    xladept - what did you feel was not working? I have reviewed again and what is functional is working as I expect. What I need help with at this point is copying merged cell "F1:F7"to the right into "G1:G7" and so on based on the value in column O on the "Data" worksheet. So in this example worksheet 123456-3 and 13456-3w would be the two that I need to copy "F1:"F7" and paste into "G1:G7" since 2 is in cell "O7" and "O11" respectively. If there was a 3 then it would also need to be copied and pasted into cell "H1:H7" and so on.

    I hope this is more clear. Thank you for your help and I am sorry for not being as clear as I may need to be.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy Merged Cell and Paste to Right "X" times

    Hi jdohio,

    I had to use a fresh copy of your sample because the M and O fields were blown off after the run - but I think that this is what you wanted:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    04-23-2013
    Location
    TX, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copy Merged Cell and Paste to Right "X" times

    PERFECT!!!

    Thanks a lot I really appreciate it.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy Merged Cell and Paste to Right "X" times

    You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1