Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I have this line of code ...
I am trying to obtain the row number in which the (date) value of qdate occurs in column B of worksheet object ws_shours.
wsh_tab (52666_KB) is accurate, and exists in workbook Staff_Hours.xlsx. (sheet#2)
qdate = 3/21/18
The value, although formatted as ddd dd-mmm, 3/21/18 exists in worksheet 52666_KB at row 75.
The line in red is breaking the code with error: "Unable to get the match property of the WorksheetFunction class."
Is anyone able to suggest a possible cause, where I should be looking for a possible problem?
Rich (BB code):
Private Sub uf9e_submit_Click()
Dim qdate As Date
Dim wsh_tab As String
Dim ws_shours As Worksheet
Dim LRow As Double
Set ws_th = Workbooks("Sports17.xlsm").Worksheets("TEMP_HOLD")
'update staff hours
With ws_th
qdate = .Range("F16")
wsh_tab = .Range("A16") & "_" & .Range("C16")
End With
Set ws_shours = Workbooks("Staff_Hours.xlsx").Worksheets(wsh_tab)
With ws_shours
LRow = Application.WorksheetFunction.Match(qdate, .Range("B:B"), 0)
End With
End Sub
I am trying to obtain the row number in which the (date) value of qdate occurs in column B of worksheet object ws_shours.
wsh_tab (52666_KB) is accurate, and exists in workbook Staff_Hours.xlsx. (sheet#2)
qdate = 3/21/18
The value, although formatted as ddd dd-mmm, 3/21/18 exists in worksheet 52666_KB at row 75.
The line in red is breaking the code with error: "Unable to get the match property of the WorksheetFunction class."
Is anyone able to suggest a possible cause, where I should be looking for a possible problem?
Last edited: