[Excel] Using the Find method
[Excel] Using the Find method
(OP)
I hate to ask these kind of questions, but... why doesn't this work? I'm getting a compile error on the Set dtFindMe line.
Sub FindDate()
Dim dtFindMe As Date
Dim rgFoundMe As Range
Set dtFindMe = DateSerial(2002, 2, 22)
Set rgFoundMe = Range("A:A").Find(what:=dtFindMe)
If rgFoundMe Is Nothing Then
Exit Sub
End If
rgFoundMe.Font.Bold = True
End Sub
Any help would be appreciated.
SM
Sub FindDate()
Dim dtFindMe As Date
Dim rgFoundMe As Range
Set dtFindMe = DateSerial(2002, 2, 22)
Set rgFoundMe = Range("A:A").Find(what:=dtFindMe)
If rgFoundMe Is Nothing Then
Exit Sub
End If
rgFoundMe.Font.Bold = True
End Sub
Any help would be appreciated.
SM





RE: [Excel] Using the Find method
Dim dtFindMe As Date
dtFindMe = CDate(DateSerial(2002, 2, 22))
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: [Excel] Using the Find method
Set rgFoundMe = Range("A:A").Find(what:=dtFindMe)
SM
RE: [Excel] Using the Find method
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: [Excel] Using the Find method
Dim dtFindMe As Date
Dim rgFoundMe As Range
dtFindMe = DateSerial(2002, 2, 22)
Set rgFoundMe = Range("A:A").Find(what:=dtFindMe)
If rgFoundMe Is Nothing Then
Exit Sub
End If
rgFoundMe.Font.Bold = True
End Sub
dtFindMe it is not an object and you do not have to use "Set". !!