View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default using if statement to compare text

Didn't you want to try:

dim myDate as Variant
mydate = activecell.value



josh wrote:

I tried changing it to a variant and got the same error. here is the
code...

ActiveCell.Value = mydate
MsgBox (mydate)
If mydate = "TK" Then
MsgBox ("worked")
Else

the cell it's looking at is formatted to date, but has the text "TK" in
it. if that matters.


--

Dave Peterson