Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to learn VBA from a STEP BY STEP written by Reed Jacobson.
He encourages using the Immediate Window because he claims you can see the progress as you code. I am copying his code verbatim. For example, in the current practice, I have the following Macro shell; Sub PivotSet Style() Dim pt as Pivottable Dim ts as Tablestyle Set pt=ActiveCell.Pivottable End sub I initialize this by pressing F8 three times, and then I type the following in the immediate window: Set ts=ActiveWorkbook.Tablestyles("PivotStyleDark2").D uplicate("NewPivotStyle") pt.Tablestyle2=ts.Name (Note: the "Set ts= ActiveWorkbook..." statement above, is all on one line in the immediate window) When I get to the last line I get an "Object Required" error message. I've checked the code and the instructions, and I cannot see anything different from what I have copied. What am I doing wrong? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
A macro code question from a novice | Excel Discussion (Misc queries) | |||
Novice formula question | Excel Discussion (Misc queries) | |||
Novice IF and COUNT question (I think) | Excel Worksheet Functions | |||
drop down list - a question from novice | Excel Discussion (Misc queries) | |||
Novice VBA question... | Excel Programming |