R
RCranston
I have a User Form init to find the first row that contains the current date
(for update) else find first empty row ( for insert). The Column "A" has
dates.
Eventually, the form would prompt for a selected date.
This is a partial list of the code:
Dim FindDate As String
Dim lRow As Integer
Dim ws As Worksheet
Set ws = Worksheets("Daily Sched")
' Set Current Date as String Format
FindDate = Format(Date, "mm/dd/yyyy")
' find first row containing current date
lRow = ws.Cells.Find(What:=FindDate, _
SearchDirection:=xlNext, _
SearchOrder:=xlByRows).Row
If lRow = 0 Then
' find first empty row in database
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
End If
I get a run time error '91'.
(for update) else find first empty row ( for insert). The Column "A" has
dates.
Eventually, the form would prompt for a selected date.
This is a partial list of the code:
Dim FindDate As String
Dim lRow As Integer
Dim ws As Worksheet
Set ws = Worksheets("Daily Sched")
' Set Current Date as String Format
FindDate = Format(Date, "mm/dd/yyyy")
' find first row containing current date
lRow = ws.Cells.Find(What:=FindDate, _
SearchDirection:=xlNext, _
SearchOrder:=xlByRows).Row
If lRow = 0 Then
' find first empty row in database
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
End If
I get a run time error '91'.