+ Reply to Thread
Results 1 to 14 of 14

copy and paste values to another sheet if value in one column matches condition

  1. #1
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Smile copy and paste values to another sheet if value in one column matches condition

    Hi
    I am trying to copy data to another sheet as values only, if it matched value on perticular column.

    VBA code to copy rows ( column A to Z) if value in Column C is 'rr' (Copy to sheet2 row 2 and below)

    It over writes existing data in sheet2 ( sample book attached)

    Any help please

    Kind regards
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy and paste values to another sheet if value in one column matches condition

    I am not sure on overwriting issue.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy and paste values to another sheet if value in one column matches condition

    If you want to first clear data in sheet2.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy and paste values to another sheet if value in one column matches condition

    my favourite loop
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: copy and paste values to another sheet if value in one column matches condition

    Hi AB33,
    Thanks very much.
    This works great.
    If I want to add another condition then what will be the code?
    I tried but it will not work. e.g. condition 'cc' & 'aa'

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy and paste values to another sheet if value in one column matches condition

    If it is OR

    Please Login or Register  to view this content.
    Last edited by AB33; 10-24-2013 at 10:56 AM.

  7. #7
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: copy and paste values to another sheet if value in one column matches condition

    Hi,
    Another solution may be by formula in conditional formatting...

    Link sheet1 to sheet2 and then do conditional formatting with formula to include...

    Like Autofilter columns A to Zwith condition that rows visible if column C has values 'aa' and 'cc'
    Other rows hidden or deleted....

    Do you think this is possible.

    Regards

    Is it possible??

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy and paste values to another sheet if value in one column matches condition

    I am completely forgotten excel functions since I have immersed my self in VBA, but why do you go a formula route while I have provided you two different codes.

  9. #9
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: copy and paste values to another sheet if value in one column matches condition

    Hi AB33
    Yes the second solution worked fine.
    Great help my friend.
    As always, I have clicked *
    Many thanks.
    I will treat this thread closed.
    We can continue conditional formatting discussions for academic purpose.
    Once a great help.
    I have also posted new thread on closing excel book at certain times. Please have a look if you are free.
    Thanks again
    Kind regards

  10. #10
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: copy and paste values to another sheet if value in one column matches condition

    Thanks AB33

  11. #11
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: copy and paste values to another sheet if value in one column matches condition

    Hi AB33,
    Just one more question which came up much later on your excellent code.
    If I have to add more criteria , what exactly I should say? I tried many combinations but it is not working.
    Please Login or Register  to view this content.
    Kind regards
    KK1234

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy and paste values to another sheet if value in one column matches condition

    Auto filter can handle two options only. You need to use array filter. Please see attached
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: copy and paste values to another sheet if value in one column matches condition

    Hi AB33,
    Thanks a lot.
    I was wondering why.
    Thanks for your help again.
    Apology for re-opening this one.
    You always have been a star to help others.
    Kind regards

  14. #14
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: copy and paste values to another sheet if value in one column matches condition

    I have again clicked * to thank you

+ 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 and paste (values) to another sheet based on condition
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-09-2013, 10:25 PM
  2. Macro to Copy Paste Values from one workbook to another if case number matches
    By lyndalhux in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2013, 11:36 AM
  3. Macro to copy values from columns of one sheet & paste it to diffrnt Column Sequence
    By kmvasudha in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2013, 06:54 AM
  4. [SOLVED] Copy and Paste a specific Column to a Column that's heading matches a particular cell
    By Rexmond in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-17-2012, 12:29 AM
  5. Macro that will copy values in Column J and paste values to Column B in new sheet
    By Phixtit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2010, 04:56 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