+ Reply to Thread
Results 1 to 10 of 10

Find value and copy the Range to another sheet with merged cells

  1. #1
    Registered User
    Join Date
    10-01-2018
    Location
    Turkey
    MS-Off Ver
    2016
    Posts
    6

    Arrow Find value and copy the Range to another sheet with merged cells

    Hi All,

    I made a lot serach on the forums and google and I found a couple of possible solutions about my problem but still the codes do not work as I like. My problem is;

    I would like to find an exact value from a column and then to copy whole rows and colums which are the value that I found. My problem is, I can find the value and copy the rows and colums to another sheet but the code just copy the rows. Merged cells look empty. I would like to copy the rows and colums like I did manually select then do copy and paste.

    I uploaded the template file that I use. In that file as you can see with blue mark, I would like to copy the merged rows exaclty as it is seen which is 17082018/17 to another sheet with VBA.

    Thank you in advance...
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Find value and copy the Range to another sheet with merged cells

    Might be easiest to just unmerge the cells.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-01-2018
    Location
    Turkey
    MS-Off Ver
    2016
    Posts
    6

    Re: Find value and copy the Range to another sheet with merged cells

    thank you quick response. But I don't want to unmerged the cells. I would like to copy all from B19 to R28 to another sheet while they are merged. I think the code should find the first row and last row of which are "18" at A column and then should copy with this range (from B19 to R28) - to another sheet. but I think we should do this with varianbles.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Find value and copy the Range to another sheet with merged cells

    Here is the code for macro.
    Value to be entered in B2 of Sheet "Copy".
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 10-01-2018 at 11:01 PM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    10-01-2018
    Location
    Turkey
    MS-Off Ver
    2016
    Posts
    6

    Re: Find value and copy the Range to another sheet with merged cells

    Thank you so much kvsrinivasamurthy! The code works perferct!

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Find value and copy the Range to another sheet with merged cells

    Thanks for the compliment.

  7. #7
    Registered User
    Join Date
    10-01-2018
    Location
    Turkey
    MS-Off Ver
    2016
    Posts
    6

    Re: Find value and copy the Range to another sheet with merged cells

    Quote Originally Posted by kvsrinivasamurthy View Post
    Thanks for the compliment.
    I had an issue about the code. If I write 17072018/01 to "B2" the code copy all the rows from 17072018/01 to 17072018/17. I need to copy just related row. I tried to modify the codes but I couldn't make it work properly. Could you please help me to revise that? Thank you.

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Find value and copy the Range to another sheet with merged cells

    Try this revised code

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    10-01-2018
    Location
    Turkey
    MS-Off Ver
    2016
    Posts
    6

    Re: Find value and copy the Range to another sheet with merged cells

    It didn't work. Now it doesn't copy the merged cells. I revised the code like this;

    Please Login or Register  to view this content.
    I put "1" to A colum which has merged cells. With If condition now the code can work as I like. Than your for your guidence.

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Find value and copy the Range to another sheet with merged cells

    This code is tested for all cases in example data.
    Please Login or Register  to view this content.

+ 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. Range.Find with merged cells
    By BuZZarD73 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2015, 12:32 PM
  2. Copy from merged cells in one sheet and paste to merged cells in another sheet
    By loroverde in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2015, 01:30 PM
  3. Replies: 1
    Last Post: 04-22-2013, 10:34 AM
  4. Using Range.find() doesn't work when the text you look for is in merged cells
    By nfuids in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-17-2012, 03:24 PM
  5. if find merged cell in a range change the reference sheet value to 0
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-06-2011, 07:41 AM
  6. Copy data from a sheet and Paste in another sheet into Merged cells
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2011, 02:01 PM
  7. Loop Through A Range, Find Cells > 1, Copy Offset To Another Sheet
    By bugmenot in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-25-2008, 06:30 PM

Tags for this Thread

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