I am hoping someone can get me straight. I had this darn thing working earlier in the day and for some reason the code no longer works.
LR = Range("A" & Rows.Count).End(xlUp).Row
With Range("A1:A" & LR)
Set LastCell = .Cells(.Cells.Count)
End With
Set FoundCell = Range("A1:A" & LR).Find(what:="Employee: ", After:=LastCell, Lookat:=x1Part)
If FoundCell.Address <> "$A$10" Then
MsgBox ("You need to use the Kronos time sheet.")
Exit Sub
End If
'Set FoundCell = Range("A1:A" & LR).Find(what:="Employee: ", after:=LastCell)
If Not FoundCell Is Nothing Then
FirstAddr = FoundCell.Address
End If
I have a large amount of data in column A and I am searching for the line that has the employee name on it. (See below)
(Employee: Lastname, Firstname ID: 124307 Time Zone: Eastern)
Right now the code stops becuase Foundcell ends up as "Nothing". It worked yesterday and eariler today so I know (hope) it works.
Please help! I am down to the last several hairs on my head.
Jim
LR = Range("A" & Rows.Count).End(xlUp).Row
With Range("A1:A" & LR)
Set LastCell = .Cells(.Cells.Count)
End With
Set FoundCell = Range("A1:A" & LR).Find(what:="Employee: ", After:=LastCell, Lookat:=x1Part)
If FoundCell.Address <> "$A$10" Then
MsgBox ("You need to use the Kronos time sheet.")
Exit Sub
End If
'Set FoundCell = Range("A1:A" & LR).Find(what:="Employee: ", after:=LastCell)
If Not FoundCell Is Nothing Then
FirstAddr = FoundCell.Address
End If
I have a large amount of data in column A and I am searching for the line that has the employee name on it. (See below)
(Employee: Lastname, Firstname ID: 124307 Time Zone: Eastern)
Right now the code stops becuase Foundcell ends up as "Nothing". It worked yesterday and eariler today so I know (hope) it works.
Please help! I am down to the last several hairs on my head.
Jim