Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
run time error 91 all of a sudden
Run time error 91 just started popping up on a macro that
you all helped me with months ago. erro 91 says object variable or With block variable not set The Marco is: Sub gotoselection() x = Cells.Find(InputBox("Enter number to find")).Address Application.Goto reference:=Range(x).Offset(, -2) End Sub I occasionaly change the -2 to a different number but it always worked. whats going on? I am in column c right now and need to jump 2 spaces to left so should be -2 like have been doing |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
run time error 91 all of a sudden
You will get this error if the item you are searching for is not found.
Sub gotoselection() Dim rng as Range set rng = Cells.Find(InputBox("Enter number to find")) If not rng is nothing then Application.Goto reference:=rng.Offset(, -2) Else msgbox "Item not found" End if End Sub -- Regards, Tom Ogilvy "Todd" wrote in message ... Run time error 91 just started popping up on a macro that you all helped me with months ago. erro 91 says object variable or With block variable not set The Marco is: Sub gotoselection() x = Cells.Find(InputBox("Enter number to find")).Address Application.Goto reference:=Range(x).Offset(, -2) End Sub I occasionaly change the -2 to a different number but it always worked. whats going on? I am in column c right now and need to jump 2 spaces to left so should be -2 like have been doing |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
run time error 91 all of a sudden
turns out there is some goofy formatting issue - if the
cell contains 05007 and you type o5007 it returns the not found but if you type 5007 it goes to the cell thanks for the time todd -----Original Message----- You will get this error if the item you are searching for is not found. Sub gotoselection() Dim rng as Range set rng = Cells.Find(InputBox("Enter number to find")) If not rng is nothing then Application.Goto reference:=rng.Offset(, -2) Else msgbox "Item not found" End if End Sub -- Regards, Tom Ogilvy "Todd" wrote in message ... Run time error 91 just started popping up on a macro that you all helped me with months ago. erro 91 says object variable or With block variable not set The Marco is: Sub gotoselection() x = Cells.Find(InputBox("Enter number to find")).Address Application.Goto reference:=Range(x).Offset(, -2) End Sub I occasionaly change the -2 to a different number but it always worked. whats going on? I am in column c right now and need to jump 2 spaces to left so should be -2 like have been doing . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
All of a sudden none of my Excel formulas are working... | Excel Worksheet Functions | |||
all of a sudden - something's different | Excel Discussion (Misc queries) | |||
All of the sudden my charts aren't active, what happened? | Charts and Charting in Excel | |||
Sudden Background Change to only one file | Excel Discussion (Misc queries) | |||
all of a sudden I can not see the graphs I made | Excel Discussion (Misc queries) |