Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
pikapika13
 
Posts: n/a
Default Silly Problem with Variable (2nd attempt)


I'm new to VBA.
I'm passing a value to "Acell":

Acell = ActiveCell


However, the following code does not work:
ActiveSheet.PivotTables("PivotTable10").PivotField s("utcid")
.PivotItems(Acell).Visible = False

But when I manually put in "37" (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: http://www.excelforum.com/member.php...o&userid=10892
View this thread: http://www.excelforum.com/showthread...hreadid=528593

  #2   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default Silly Problem with Variable (2nd attempt)

Since 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 Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default Silly Problem with Variable (2nd attempt)

To 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 Backmann


"pikapika13" wrote:


I'm new to VBA.
I'm passing a value to "Acell":

Acell = ActiveCell


However, the following code does not work:
ActiveSheet.PivotTables("PivotTable10").PivotField s("utcid")
.PivotItems(Acell).Visible = False

But when I manually put in "37" (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: http://www.excelforum.com/member.php...o&userid=10892
View this thread: http://www.excelforum.com/showthread...hreadid=528593


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
variable height variable width stacked bar charts ambthiru Charts and Charting in Excel 3 January 18th 06 11:41 PM
problem with Array Formula OrdOff Excel Worksheet Functions 2 June 30th 05 04:57 PM
Copy an Drag cell Formula Problem Nat Excel Discussion (Misc queries) 1 June 20th 05 03:24 PM
Paper Tray selection Problem, Michael Hoffmann Excel Discussion (Misc queries) 4 December 3rd 04 09:08 PM
File is locked for Editing by user problem Mirth Excel Discussion (Misc queries) 1 December 3rd 04 04:45 PM


All times are GMT +1. The time now is 12:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"