I am having an issue pulling dates from one workbook.sheet to another workbook.sheet. I've been working through the code. not sure if this is close or not.
The due1st spreadsheet's name will change daily. Need the code to reflect that also.
The due1st spreadsheet's name will change daily. Need the code to reflect that also.
VBA Code:
Dim sh As Worksheet, lr As Long, rng As Range, sh2 As Worksheet, lr2 As Long, c As Range
Set sh = Workbooks("Training Matrix.xls").Worksheets("Current Emp") 'Edit sheet name - Source
Set sh2 = Workbooks("DUE1st" & "*" & ".xls").Worksheets("Sheet1") 'Edit Sheet name - Destination
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
Set rng = sh.Range("F6:BB400" & lr)
For Each c In rng
If DateValue(c.value) <= Workbooks("Training Matrix.xls").Worksheets("Current Emp Key").Cells("I2") Then
'DateValue(Date) Then
lr2 = sh2.Cells(Rows.Count, 1).End(xlUp).Row + 1
c.EntireRow.Copy sh2.Range("A" & lr2)
End If
Next