LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Selecting next drop down item in pivot table with a macro ???

Thanks for the reply Tom!

I think the best thing I can take out of that is probably the simplest
thing, escaping to a variable within the page name using & var & , I
haven't used this language so did not know how to include variables
(had tried all variations of methods I knew! :)

What I've done is used primitive excel macros and C&P the drop down
field into another cell, which copies it as just a general cell, I've
then copied the cell to the cell below, which has incremented it's
value from Week 1 to Week 2 , I then create a variable varWeek from
that new cell, and set the current page name to

CurrentPageName = "[Time By Week].[All Time By Week].[2005]. _
["& varWeek & "]"

Works a treat! Thankfully this works well too...

IF varWeek "Week 52"
THEN varWeek = "Week 1"
ENDIF

I've also replace the year with a variable, with I get with the
following

varYear = Trim(VBA.Format(Now(), "YYYY"))

Hoepfully this means, when the macro runs in the 1st week of 2006, it
will select 2006 as the year and reset Week to Week 1. Thanks for
helping me in simplifying this for me!!

Regards,
Keilan

 
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
Running a macro when selecting an item in a drop-down list Christine Excel Discussion (Misc queries) 4 August 1st 08 08:50 PM
Selecting the current month using a macro on a pivot table Newbee Excel Discussion (Misc queries) 3 November 12th 06 07:10 PM
Selecting a range of values on pivot table attribute with a macro Ryan Hartnett Excel Discussion (Misc queries) 1 October 24th 06 10:21 PM
Pivot Table Looses Drop-Down Choice When Only One Item Displayed MarvInBoise Excel Discussion (Misc queries) 3 May 12th 06 06:33 PM
changing value of a cell by selecting an item from a drop down list Bobby Mir Excel Worksheet Functions 6 June 8th 05 08:33 PM


All times are GMT +1. The time now is 10:49 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"