Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Runtime error '1004' General ODBC error | New Users to Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Interior class error/runtime error 1004 | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming | |||
Unknown where is the problem on the Runtime error - Automation error | Excel Programming |