Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
variable height variable width stacked bar charts | Charts and Charting in Excel | |||
problem with Array Formula | Excel Worksheet Functions | |||
Copy an Drag cell Formula Problem | Excel Discussion (Misc queries) | |||
Paper Tray selection Problem, | Excel Discussion (Misc queries) | |||
File is locked for Editing by user problem | Excel Discussion (Misc queries) |