LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Please help!

I am trying to use selection.find for a word that may or may not be in the
specified search. My problem is that when I do the selection find and it
doesn't find the word, the macro stops and prompts me to debug with the
following message:

Object variable or With Block variable not set.

Here is where the bug is located:

Range("V38,V45,V52,V58,V65,V72,V78,V84").Select
If Range("AG21").Value = "N" And ActiveCell < "Tony" Then
Selection.Find(What:="Alternate", After:=ActiveCell, LookIn:
=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.FormulaR1C1 = "Tony"
End If

Now I think the problem is that it can't Activate a cell because it did NOT
find the word "Alternate". How can I write the code so it will work?


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"