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: 11
Default Runtime error 91

I want to search a special character in my selected range of Excel sheet and
replace it with "A". I am using code mentioned below.

Public Sub test()

Dim firstaddress As String

Range("A418", "I441").Select

Set temp = Selection.Find(what:="$", After:=ActiveCell,
LookIn:=xlFormulas, LookAt:=xlPart)

If Not temp Is Nothing Then
firstaddress = temp.Address
Do
Range(temp.Address).FormulaR1C1 = "A"
Set temp = Selection.FindNext(temp)
Loop While Not temp Is Nothing And temp.Address < firstaddress

End If
End Sub

It works fine till it find the requested characters. Once it didnot find
anything it returns an Runtime error 91! Any solution for this?

Thanks in advane.
 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Interior class error/runtime error 1004 David Goodall Excel Programming 1 October 24th 04 10:16 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM
Unknown where is the problem on the Runtime error - Automation error wellie Excel Programming 1 July 10th 03 08:12 AM


All times are GMT +1. The time now is 02:31 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"