I need help to resolve the “Type Mismatch” error.
Posting this is a bit of a cop out!! But having spent last few hours trying to solve it myself, I turn to my trusted source for help!!
Code is this:-
Getting Compile error = Type Mismatch, on this line:
Posting this is a bit of a cop out!! But having spent last few hours trying to solve it myself, I turn to my trusted source for help!!
Code is this:-
VBA Code:
Sub MeUsedRangetest()
Dim lastRow As Long, firstrow As Long
Dim rng As Range
Dim sht As Worksheet
Set sht = ThisWorkbook.ActiveSheet
Set rng = sht.Range("T:T").Find(what:="CF rules", LookIn:=xlValues, LookAt:=xlWhole).Row
Set rng = sht.Range("T:T").Find(what:="Cash Paid", LookIn:=xlValues, LookAt:=xlWhole).Row
firstrow = sht.Range("T:T").Find(what:="CF rules", LookIn:=xlValues, LookAt:=xlWhole).Row
lastRow = sht.Range("T:T").Find(what:="Cash Paid", LookIn:=xlValues, LookAt:=xlWhole).Row
MsgBox "Range is " & rng.Address
End Sub
Getting Compile error = Type Mismatch, on this line:
VBA Code:
Set rng = sht.Range("T:T").Find(what:="CF rules", LookIn:=xlValues, LookAt:=xlWhole).Row