Hi,
I have the below code copying data from one workbook to two others and it works fine.
However, when pasting to wb2 (penultimate line of the if statement) I would like to reformat col A to 'workday(date(), -1)' with format dd/mm/yyyy. How could I add that into the code?
I have the below code copying data from one workbook to two others and it works fine.
However, when pasting to wb2 (penultimate line of the if statement) I would like to reformat col A to 'workday(date(), -1)' with format dd/mm/yyyy. How could I add that into the code?
VBA Code:
lrw = ws.Range("A" & Rows.Count).End(xlUp).Row
lrw2 = ws.Range("B" & Rows.Count).End(xlUp).Row
If lrw > 2 Then
lc = ws.Cells(1, Columns.Count).End(xlToLeft).Column
lr = wb.Range("A" & Rows.Count).End(xlUp).Row + 1
lr2 = wb2.Range("A" & Rows.Count).End(xlUp).Row + 1
ws.Rows("3:" & lrw).Copy
wb.Range("A" & lr).PasteSpecial xlPasteAll
wb2.Range("A" & lr2).PasteSpecial xlPasteAll
ws.Range(ws.Cells(3, 1), ws.Cells(lrw, lc)).EntireRow.ClearContents
End If