Dear All
How I edit my code VBA mapping Value and send output to a new column
1.Check Input Value Worksheets("sheet1").Range(" J2:J21").Select and
Worksheets("sheet1").Range("B3:D7").Select (Blue)
2.If Worksheets("sheet1").Cell(" J2") = Worksheets("sheet1").Range("B3")
3.Send output Value a tWorksheets("sheet1").Cell(" A3") to Worksheets("sheet1").Range("K2") (Yellow)
4.Send output Value at Worksheets("sheet1").Cell(" B2") to Worksheets("sheet1").Range("L2") (Red)
Please download my file at google drive mapping.xlsm
Best regards
art
How I edit my code VBA mapping Value and send output to a new column
1.Check Input Value Worksheets("sheet1").Range(" J2:J21").Select and
Worksheets("sheet1").Range("B3:D7").Select (Blue)
2.If Worksheets("sheet1").Cell(" J2") = Worksheets("sheet1").Range("B3")
3.Send output Value a tWorksheets("sheet1").Cell(" A3") to Worksheets("sheet1").Range("K2") (Yellow)
4.Send output Value at Worksheets("sheet1").Cell(" B2") to Worksheets("sheet1").Range("L2") (Red)
Please download my file at google drive mapping.xlsm
Best regards
art
VBA Code:
Dim Na As Long, Nc As Long, Ne As Long
Dim i As Long
REFER = Worksheets("sheet1").Cells(Rows.Count, "J").End(xlUp).Row
Nc = Worksheets("sheet1").Cells(Rows.Count, "A").End(xlUp).Row
Ne = 1
For i = 2 To REFER
For j = 1 To Nc
'If REFER = Nc Then Skip
If Worksheets("sheet1").Cells(j, "J").Value = Worksheets("sheet1").Cells(i, "A").Value Then
Exit For
End If
Next j
If (j - 1) = Nc Then
Worksheets("sheet1").Cells(Ne, "K").Value = Worksheets("sheet1").Cells(i, "A").Value
Ne = Ne + 1
End If
Next i