+ Reply to Thread
Results 1 to 5 of 5

Macro to copy cells based on the value of another cell

  1. #1
    Registered User
    Join Date
    09-13-2005
    Posts
    59

    Macro to copy cells based on the value of another cell

    the data is like this:

    Col A Col B

    10
    20
    30 X
    40
    50
    60 X

    i would like a macro to copy only 30 and 60 because there is an "X" against them in column B.

    i would like the macro to copy this values on the clipboard or a list with no blanks..

    can anyone help? thanx

  2. #2
    Registered User
    Join Date
    08-16-2007
    Location
    Portsmouth, UK
    Posts
    86
    This first bit of code will work providing that x is found nowehere else in the sheet except in the column next to the data you want to transfer

    Please Login or Register  to view this content.

    This is a slightly modified version which restricts the search range to just the column next to the data so will work if x can be found elsewhere in the speardsheet.

    Please Login or Register  to view this content.
    Just change the column references as needed.

    Hope this helps, Robyn

  3. #3
    Registered User
    Join Date
    08-16-2007
    Location
    Portsmouth, UK
    Posts
    86
    PS I have no idea how to copy values to the clipboard so can't help there, sorry

  4. #4
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Hi,

    Here are some bones of a macro to work with - not tested b/c I don't have excel open at the moment & I modified some previously exported macros to give the below...

    Please Login or Register  to view this content.
    I hope it works as is but if not let us know & someone should be able to help - I'm off to sleep now.

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  5. #5
    Registered User
    Join Date
    09-13-2005
    Posts
    59
    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)

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