Results 1 to 1 of 1

Thread: Excel VBA Macro to copy paste values using if match condition

  1. #1

    Excel VBA Macro to copy paste values using if match condition



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

    Hi, Need your help for the following.


    In Sheet2 A1 to O1 there are predefined header values, as below.


    A1 B1 O1
    JVM1 JVM2 ... JVM15
    or contrast to this Sheet2 A1 to O1 header values are


    A1 B1 O1
    #JVM1 #JVM2 ... #JVM15
    User uses dropdown in Sheet1 B3 to select JVM1 to enter details if #JVM1 not details would be entered.


    So, the cell values of Sheet1 B3 = Sheet2 R3 = Sheet2 A1 = JVM1 should copy.


    If found #JVM1 should not copy.


    **Sheet2**


    PasteSpecial PasteSpecial PasteSpecial


    Sheet2 A2 Sheet2 B2 Sheet2 C2


    JVM1 JVM2 JVM3
    somevalue somevalue somevalue
    somevalue1 somevalue1 somevalue1
    somevalue2 somevalue2 somevalue2
    somevalue3 somevalue3 somevalue3
    somevalue4 somevalue4 somevalue4
    somevalue5 somevalue5
    somevalue6
    somevalue7


    Click button Update in Sheet1.


    If Sheet1 B3 value = Sheet2 R3 value = Sheet2 A1 value.


    Copy Sheet2 Q4 xldown values, pasteSpecial values in Sheet2 A2.


    Clear range Sheet1 B3 xldown.


    Put the next value in range A1 to O1 only if not hash value = JVM2(not #JVM2). Say Sheet2 B1 = Sheet1 B3.


    Repeat the process


    Click button Update in Sheet1.


    If Sheet1 B3 value = Sheet2 R3 value = Sheet2 A1 value.


    Copy Sheet2 Q4 xldown values, pasteSpecial values in Sheet2 B2.


    Clear range Sheet1 B3 xldown.


    Put the next value in range A1 to O1 only if not hash value = JVM3(not #JVM3). Say Sheet2 C1 = Sheet1 B3.


    Repeat the process ...


    Have attached a sample workbook for reference.


    Please suggest thanks
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

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