Find date problem---c is still nothing

poorwallace

Active Member
Joined
Mar 8, 2005
Messages
365
I've got a small macro here which worked on my home computer but is not working here at work....I can't seem to figure out why (it looks good to me). I was hoping somebody could figure out where I'm mistepping. The problem, specifically, is that at the "set c" part of the code, c is not being found, when it clearly is in the range...I've gone to the immediate window and checked.....

Thanks

Code:
Sub test()

Dim todaydate
todaydate = Date

With Sheets("Supplement").Range("A1:A10000")
    Set c = .Find(todaydate, LookIn:=xlValues)
 
    If Not c Is Nothing Then
        c.Offset(0, 7).Copy
        c.Offset(0, 7).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
        Application.CutCopyMode = False
    End If
 
End With

End Sub
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

poorwallace

Active Member
Joined
Mar 8, 2005
Messages
365
Thanks! That worked! However, why is it that the xlformulas worked, while couldn't use xlValues? Clicking into the cell, it is not a formula...Am I not understanding something fairly simple here (it wouldn't be the first time :p )...If anyone could give a possible explanation to me why xlFormula worked when xlValues did not (though it did on my home computer), I would really appreciate it.

Anyways, thanks!
 

Watch MrExcel Video

Forum statistics

Threads
1,118,013
Messages
5,569,620
Members
412,283
Latest member
camgree
Top