Re: Excel: hide multiple columns with Applescript
Re: Excel: hide multiple columns with Applescript
- Subject: Re: Excel: hide multiple columns with Applescript
- From: David Wignall <email@hidden>
- Date: Mon, 21 Mar 2011 22:21:31 +1300
On 21 Mar 2011, at 9:03 PM, Cameron Knowlton wrote:
> ah, but that will hide the entire pivot field... I only want to hide a certain number of pivot items (visually, columns of that pivot field).
set Pivot_Table to pivot table 1 of active sheet
-- pivot table 1 of active sheet
name of column fields of Pivot_Table
-- {"Salesperson"}
set Column_Field to column field "Salesperson" of Pivot_Table
-- column field "Salesperson" of pivot table 1 of active sheet
name of pivot items of Column_Field
-- {"Andrew Fuller", "Anne Dodsworth", "Janet Leverling", "Laura Callahan", "Margaret Peacock", "Michael Suyama", "Nancy Davolio", "Robert King", "Steven Buchanan"}
repeat with Item_Name in {"Andrew Fuller", "Anne Dodsworth", "Laura Callahan"}
set visible of pivot item Item_Name of Column_Field to false
end repeat
All of which works but when I tested with a different field, one with 89 items it took a noticeable time, complete with SPOD but less than 1 minute, to create the list of names. However it took no real time at all to hide all those fields, so if you already know the names then that's irrelevant. (Errored on the last one because at least 1 field must be visible).
--
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden