Results 1 to 3 of 3

Thread: VBA to COPY cell with conditions

  1. #1

    VBA to COPY cell with conditions

    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi everyone,

    I have "Sheet1" and "Sheet2"

    In need to add a VBA for conditional cell copy like this :
    IF Sheet1 (Cell"A23") = Sheet2 (a cell in Column"A") THEN copy the "Sheet2" same line cell from column B TO Sheet1("B2")

    To be clear :
    IF Sheet1 (Cell"A23") = Text_To_Find
    SEARCH in Sheet2 (a cell in Column"A") = Text_To_Find (ex: A12)
    THEN Copy B12 TO Sheet1 (Cell"B2")

    Hope my explanations are clear.
    Thanks a lot

  2. #2
    Yeah, I have found the trick with no VBA:

    In the Sheet1 (Cell"B2") I put this :
    And it's works !!


  3. #3
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Nanaimo, BC, Canada
    Blog Entries
    Excel Version
    Excel Office 365 Insider
    Sorry that I didn't get here sooner to answer, but I'm glad you worked out a solution. Almost always better to go the formula route instead of VBA if possible.
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book Master Your Data for Excel and Power BI, or our new Power Query Recipe cards!

    Main Site: -||- Blog: -||- Forums:
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Posting Permissions

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