+ Reply to Thread
Results 1 to 11 of 11

copy/paste to merged cells

  1. #1
    Registered User
    Join Date
    08-25-2013
    Location
    Epsom
    MS-Off Ver
    2013
    Posts
    59

    copy/paste to merged cells

    Greetings Excel Gurus,

    I am trying to find an easy way of how to copy a selection of 12 cells into cells that have been merged.
    i am attaching a file with example.
    Any help would be appreciatted
    Thanks in advance
    Attached Files Attached Files
    Rome wasn't built in a day

  2. #2
    Registered User
    Join Date
    08-25-2013
    Location
    Epsom
    MS-Off Ver
    2013
    Posts
    59

    Re: copy/paste to merged cells

    my initial idea was to record some macros with a prompt for user to select data to be copied..

  3. #3
    Forum Contributor
    Join Date
    09-30-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    229

    Re: copy/paste to merged cells

    It isn't clear what you're trying to do here. Can you update the sheet with an example?
    Are you looking for a formula or a vba macro?

  4. #4
    Registered User
    Join Date
    08-25-2013
    Location
    Epsom
    MS-Off Ver
    2013
    Posts
    59

    Re: copy/paste to merged cells

    oh sorry:
    intention is to copy any 12 cell selection into ITEM column where cells are merged due to a format of a document
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-30-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    229

    Re: copy/paste to merged cells

    This code will do it. I don't know off hand if there's a way to determine the starting row of a merge cell programmatically. May be.
    The other consideration would be knowing how the value in column A relates to the start of the merged row.
    Please Login or Register  to view this content.
    Thing to remember is that excel vba references standard columns, and doesn't take into account merged columns.

  6. #6
    Registered User
    Join Date
    08-25-2013
    Location
    Epsom
    MS-Off Ver
    2013
    Posts
    59

    Re: copy/paste to merged cells

    Thanks. How will it work? i am just trying to understand the code here would it be possible to promp a message where user could select range for cells to be copied?

  7. #7
    Forum Contributor
    Join Date
    09-30-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    229

    Re: copy/paste to merged cells

    There's a couple of ways to handle specifying the locations:
    • form pop-up after you click on a button
    • have some cells designated for input and do merge on a button click
    How you'd set it up depends on the work flow.

  8. #8
    Registered User
    Join Date
    08-25-2013
    Location
    Epsom
    MS-Off Ver
    2013
    Posts
    59

    Re: copy/paste to merged cells

    have you tried it? it does not seem working for me. if i do it right: copy this code into a new module and run it, but before i have to have something copied right? sorry i am not good in VBA

  9. #9
    Forum Contributor
    Join Date
    09-30-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    229

    Re: copy/paste to merged cells

    Yes, I tested the code before posting. I used your spreadsheet as the example.
    Right now the code is specific to your example. The data to copy (Source) needs to start in K4; the are to copy to (Target) starts in D3; and there are 3 rows before the next cell to copy to.
    Yes, you need to have data in the source column.

    If you use the code below, you can change:
    - where to copy the data from by changing the values of nSCol & nSRow.
    - where to copy the data to by changing the values of nTCol & nTRow
    - if you change # of rows between target cells, change the value of nIncr

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    08-25-2013
    Location
    Epsom
    MS-Off Ver
    2013
    Posts
    59

    Re: copy/paste to merged cells

    hectop,

    Thanks a lot! that it works like a charm and very nice communication with you.

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: copy/paste to merged cells

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy & paste merged cells between worksheets
    By nc_4080 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-29-2013, 10:46 PM
  2. copy/paste formulas across merged cells?
    By juanzo007 in forum Excel General
    Replies: 2
    Last Post: 11-25-2010, 11:09 PM
  3. Macro to Add Row and Copy/Paste Merged Cells
    By dipitududa2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2006, 09:35 AM
  4. [SOLVED] Copy/Cut/Paste of Merged Cells in Shared Protected Workbooks
    By DaveyC4S in forum Excel General
    Replies: 0
    Last Post: 09-20-2005, 09:05 AM
  5. Copy/Paste Merged Cells via Macro is not working
    By Peter Bassett in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2005, 04:06 PM

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