Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm trying to run a macro that I did not set-up and the person that did is no
longer with the company. I keep getting this error. Can someone explain what I need to look for to find what's causing this error? Any help will be appreciated. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
An object type variable (such as a Range variable) must be Set to
some existing object before it can be used. For example, Dim Rng As Range declares that Rng is a variable of type Range, but at this point it doesn't refer to any specific range. Therefore, if you then use code like Rng.Value = 123 you'll get an error 91, because Rng doesn't refer to anything -- it isn't Set to an existing range. Your code needs to set the Rng variable to an existing range with code like Set Rng = Range("A1") Now that Rng refers to an actual range (it has been Set to a range), you can use it in your code, as in Rng.Value = 123 In this example, I used a Range type variable, but the same concepts apply to any Object type variable (e.g., a worksheet, a workbook, etc). It would be helpful if you posted the code that is causing the error. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "KristyBT" wrote in message ... I'm trying to run a macro that I did not set-up and the person that did is no longer with the company. I keep getting this error. Can someone explain what I need to look for to find what's causing this error? Any help will be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
time sheet drop down lists | Excel Discussion (Misc queries) | |||
make macros usable! make instructions in plain english !!!! | Excel Worksheet Functions | |||
object variable or with block variable not set | Excel Discussion (Misc queries) | |||
Setting x axis scale to time with variable intervals | Charts and Charting in Excel | |||
Variable time calculation | New Users to Excel |