C
Carlee
Hi there,
I am trying to use this code to make sure a value doesn't exist in the
Copreco Master Log. I get an error that says 'variable not defined' and it
highlights ' the "mydate" row.
I am not sure what is wrong...any ideas?
Assumes both workbooks are open:
Sub ckDte()
Dim wkb1 as Workbook
Dim wkb2 as workbook
Set wkb1 = Workbooks("Corpreco Daily Reading Submission.xls")
Set wkb2 = workbooks("Corpreco Master Log.xls")
myDte = wkb1.Sheets("Sheet1").Cells(2, 1).Value
For Each c In wkb2.Sheets("Daily Reading Master Log").Range("B2:B" & Cells
_(Rows.Count, 2).End(xlUp).Row)
If c = myDte Then
MsgBox "Date Found"
Exit Sub
End If
Exit Sub
I am trying to use this code to make sure a value doesn't exist in the
Copreco Master Log. I get an error that says 'variable not defined' and it
highlights ' the "mydate" row.
I am not sure what is wrong...any ideas?
Assumes both workbooks are open:
Sub ckDte()
Dim wkb1 as Workbook
Dim wkb2 as workbook
Set wkb1 = Workbooks("Corpreco Daily Reading Submission.xls")
Set wkb2 = workbooks("Corpreco Master Log.xls")
myDte = wkb1.Sheets("Sheet1").Cells(2, 1).Value
For Each c In wkb2.Sheets("Daily Reading Master Log").Range("B2:B" & Cells
_(Rows.Count, 2).End(xlUp).Row)
If c = myDte Then
MsgBox "Date Found"
Exit Sub
End If
Exit Sub