Goldfish31415
New Member
- Joined
- Jun 18, 2011
- Messages
- 1
Hi everybody,
If somebody could give me some guidance here, it would be much much appreciated.
Quite new to VBA and trying to create a macro (assigned to a button) that expands and collapses the first column of a pivot table. And have been trying for 2 hours now![Frown :( :(](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
So far, I just used the recorder and got: (note am using Mac Excel 2011)
Sub collapse()
Worksheets("renovaties pivot").Select
Range("B8").Select
ExecuteExcel4Macro "(""PivotTable1"",""categorie"",FALSE)"
End Sub
But when running the macro -> doesn't work
I then searched forums etc for some guidance and read that you need to specify the full name of the file with the 'ExecuteExcel4Macro' so I tried
ExecuteExcel4Macro "(""Workbooks(""immo investering_16.xlsm"").Worksheets(""renovaties pivot"").PivotTables(""PivotTable1"")"",""categorie"",FALSE)"
but doesn't work either, did I just get lost in the forest of brackets?
tanx a million already
Philip
If somebody could give me some guidance here, it would be much much appreciated.
Quite new to VBA and trying to create a macro (assigned to a button) that expands and collapses the first column of a pivot table. And have been trying for 2 hours now
So far, I just used the recorder and got: (note am using Mac Excel 2011)
Sub collapse()
Worksheets("renovaties pivot").Select
Range("B8").Select
ExecuteExcel4Macro "(""PivotTable1"",""categorie"",FALSE)"
End Sub
But when running the macro -> doesn't work
I then searched forums etc for some guidance and read that you need to specify the full name of the file with the 'ExecuteExcel4Macro' so I tried
ExecuteExcel4Macro "(""Workbooks(""immo investering_16.xlsm"").Worksheets(""renovaties pivot"").PivotTables(""PivotTable1"")"",""categorie"",FALSE)"
but doesn't work either, did I just get lost in the forest of brackets?
tanx a million already
Philip