Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable produces a complie error
I have a macro that takes a variable value from a cell on
a specific sheet. This worked just fine the first three months we ran the thing and now I get "Compile error: Object required". Am I missing something? I can't figure out what's wrong. Dim myMonth as Integer Set myMonth = Worksheets ("BANNER DATA").Range ("A2") The cell has the correct number in it. Thanks for any help you can offer. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable produces a complie error
"Set" is used in assigning an object to an object variable. You're
assigning the default range property (.Value) to an integer variable. To assign a value, you can use the optional Let (or, like 99.99% of users, leave it out). Dim myMonth As Integer Let myMonth = Worksheets("BANNER DATA").Range("A2").Value or Dim myMonth As Integer myMonth = Worksheets("BANNER DATA").Range("A2").Value In article , "Btinker" wrote: I have a macro that takes a variable value from a cell on a specific sheet. This worked just fine the first three months we ran the thing and now I get "Compile error: Object required". Am I missing something? I can't figure out what's wrong. Dim myMonth as Integer Set myMonth = Worksheets ("BANNER DATA").Range ("A2") The cell has the correct number in it. Thanks for any help you can offer. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2002 produces error in calculation. | Excel Discussion (Misc queries) | |||
Refresh produces #N/A error | Links and Linking in Excel | |||
Refresh produces #N?A error | Excel Discussion (Misc queries) | |||
How to fix "complie error:procedures" in Excel? | Excel Discussion (Misc queries) | |||
CreateObject produces error | Excel Programming |