Hello,
I know that I've spent too much time on this but just cant seem to get it to work. I am wanting to copy a date from one sheet (AllSalesData) to another (Data3BDS). I keep getting #NAME? in the cells. I've read a FAQ on dates, tried various code and still get #NAME?
Thanks.
I know that I've spent too much time on this but just cant seem to get it to work. I am wanting to copy a date from one sheet (AllSalesData) to another (Data3BDS). I keep getting #NAME? in the cells. I've read a FAQ on dates, tried various code and still get #NAME?
Code:
Sub VLookupCopyOriginalInvoiceDate()
Sheets("Data3BDS").Select 'sheet to receive info
Dim LastRow As Variant
'Dim LastRow As Long
LastRow = Range("A65536").End(xlUp).Row
With Range("D2")
.Value = "=worksheetfunction.VLookup(A2, AllSalesData!$A$2:$B$" & LastRow & ", 2, False)"
'.Value = "=application.VLookup(A2, AllSalesData!$A$2:$B$" & LastRow & ", 2, False)"
'.Value = "=VLookup(A2, AllSalesData!$A$2:$B$" & LastRow & ", 2, False)"
.AutoFill Destination:=Range(Cells(.Row, .Column), Cells(Cells(2, 4) _
.End(xlDown).Row, .Column)), Type:=xlFillDefault
End With
End Sub