Excel VBA Macro to copy paste values using if match condition

123raajesh

New member
Joined
May 1, 2014
Messages
7
Reaction score
0
Points
0
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
 

Attachments

  • Book1.xlsx
    16.2 KB · Views: 116
Back
Top