I'm new to VBA.
I'm passing a value to quot;Acellquot;:
Acell = ActiveCellHowever, the following code does not work:
ActiveSheet.PivotTables(quot;PivotTable10quot;).PivotField s(quot;utcidquot;)
.PivotItems(Acell).Visible = False
But when I manually put in quot;37quot; (in quotes), it works. Please help.
BTW, is there a way to follow your code step by step? similar to the
formula auditing tool in Excel?--
pikapika13
------------------------------------------------------------------------
pikapika13's Profile: www.excelforum.com/member.php...oamp;userid=10892
View this thread: www.excelforum.com/showthread...hreadid=528593Since ActiveCell returns an object, assignment must be made with Set:
Set Acell = ActiveCell
It would be a good idea to first declare Acell
Dim Acell as Object '-----or
Dim Acell as Range
Also, PivotItems probably needs Acell.Value (what is the 37?)
HTH
Kostis VezeridesTo pass the value to ACell
Acell = ActiveCell.value
To step through a procedure, press the F8 key to execute line by line. You
can also set breakpoints by moving to the line you want execution to stop on
and pressing F9.
Then when you run your code, either by running the macro from the menu or
pressing F5 in a module, it will execute to the breakpoint, and you can F8
your way through the procedure from there. At any time you can press F5 to
run the procedure to completion.
--
Kevin Backmannquot;pikapika13quot; wrote:
gt;
gt; I'm new to VBA.
gt; I'm passing a value to quot;Acellquot;:
gt;
gt; Acell = ActiveCell
gt;
gt;
gt; However, the following code does not work:
gt; ActiveSheet.PivotTables(quot;PivotTable10quot;).PivotField s(quot;utcidquot;)
gt; .PivotItems(Acell).Visible = False
gt;
gt; But when I manually put in quot;37quot; (in quotes), it works. Please help.
gt;
gt; BTW, is there a way to follow your code step by step? similar to the
gt; formula auditing tool in Excel?
gt;
gt;
gt; --
gt; pikapika13
gt; ------------------------------------------------------------------------
gt; pikapika13's Profile: www.excelforum.com/member.php...oamp;userid=10892
gt; View this thread: www.excelforum.com/showthread...hreadid=528593
gt;
gt;
- May 27 Tue 2008 20:44
Silly Problem with Variable (2nd attempt)
close
全站熱搜
留言列表
發表留言