Hi all,
I'm using the following code
debug.print (when commenting out SearchRow = to prevent error) shows: "24/01/2022 09:00:00 0 44585.375 44585.375"
This means that A14 in ws1 SHOULD match sTime? instead I'm given the debug type-mistmatch error 13 because it can't find a match.
Any ideas why it cannot match the value of sTime and A14 to give me the row number I'm looking for?
Thanks all
I'm using the following code
VBA Code:
Sub test3()
Dim ws1 As Worksheet, ws2 As Worksheet
Dim promostartDateTime As Date
Dim SearchRow As Integer
Dim sTime As Double
Set ws1 = Worksheets(1)
Set ws2 = Worksheets(2)
promostartDateTime = Application.WorksheetFunction.Text(ws2.Range("A2"), "dd/mm/yyyy") & " " & Application.WorksheetFunction.Text(ws2.Range("F2"), "hh:mm:ss") 'can ignore this line
sTime = CDate(promostartDateTime)
SearchRow = Application.Match(sTime, ws1.Range("A4:A148"), 0)
Debug.Print promostartDateTime; SearchRow; ws1.Range("A14").Value; sTime 'just looking to see what the values are
End Sub
debug.print (when commenting out SearchRow = to prevent error) shows: "24/01/2022 09:00:00 0 44585.375 44585.375"
This means that A14 in ws1 SHOULD match sTime? instead I'm given the debug type-mistmatch error 13 because it can't find a match.
Any ideas why it cannot match the value of sTime and A14 to give me the row number I'm looking for?
Thanks all