Hi,
I am extremely new to macro and I am confused with a simple task that requires me to populate execution date for a set of identifiers. Please find attached the workbook for your reference.
I want the "Execution date" (Column D, Data sheet) to be pasted in Column B of Target sheet, next to their respective identifiers. The data is to be populated from Data sheet that contains the identifiers (Column I) and execution dates.
I hope I have explained it right. The codes I am using is not working. Please see the below codes for your reference, although I know my logic is completely wrong:
I would appreciate if you could help me with this. Thanks!
I am extremely new to macro and I am confused with a simple task that requires me to populate execution date for a set of identifiers. Please find attached the workbook for your reference.
I want the "Execution date" (Column D, Data sheet) to be pasted in Column B of Target sheet, next to their respective identifiers. The data is to be populated from Data sheet that contains the identifiers (Column I) and execution dates.
I hope I have explained it right. The codes I am using is not working. Please see the below codes for your reference, although I know my logic is completely wrong:
Code:
Sub ADDCLM()
On Error Resume Next
Dim CD_Row As Long
Dim CD_Clm As Long
Table1 = Sheet1.Range("A2:A9133")
Table2 = Sheet2.Range("I2:I11523")
CD_Row = Sheet1.Range("B2").Row
CD_Clm = Sheet1.Range("B2").Column
For Each cl In Table1
Sheet1.Cells(CD_Row, CD_Clm) = Application.WorksheetFunction.VLookup(cl, Table2, 4, False)
CD_Row = CD_Row + 1
Next cl
MsgBox "Completion date done"
End Sub
Attachments
Last edited by a moderator: