Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Selecting todays date

Any way to rewrite the code below to choose whatever the current date
is instead of a specific date? =today().


ActiveSheet.PivotTables("PivotTable1").PivotFields
("DATE").CurrentPage = _
"12/22/08"


I am trying to set up the sheet code to refresh the two pivot tables
on the page and then change the dates to whatever the current date
whenever the sheet is selected.

thanx
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Selecting todays date

This should give you the current date in your systems default format.

ActiveSheet.PivotTables("PivotTable1").PivotFields ("DATE"). _
CurrentPage = Date



"J.W. Aldridge" wrote:

Any way to rewrite the code below to choose whatever the current date
is instead of a specific date? =today().


ActiveSheet.PivotTables("PivotTable1").PivotFields
("DATE").CurrentPage = _
"12/22/08"


I am trying to set up the sheet code to refresh the two pivot tables
on the page and then change the dates to whatever the current date
whenever the sheet is selected.

thanx

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Selecting todays date

Thanx!

That works...


One question though...

How to change the format on that...?

My current date format is ##-Mmm.
The default is mm/dd/yyyy.

Although the date populates in the pivot table field, it does not
actually work because of the difference in format.

Thanx again
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Selecting todays date

ActiveSheet.PivotTables("PivotTable1").PivotFields ("DATE").CurrentPage _
= format(Date,"dd-mmm")

Is ##-Mmm the day number (2 digits) and the abbreviated month name?

"J.W. Aldridge" wrote:

Thanx!

That works...

One question though...

How to change the format on that...?

My current date format is ##-Mmm.
The default is mm/dd/yyyy.

Although the date populates in the pivot table field, it does not
actually work because of the difference in format.

Thanx again


--

Dave Peterson
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
is there a formula that will subtract todays date from a hire date Heather Excel Worksheet Functions 5 April 25th 23 07:44 PM
Selecting and keeping todays date houghi Excel Discussion (Misc queries) 8 March 21st 08 10:32 PM
Exel increment date problem wrt todays date. [email protected] Excel Worksheet Functions 1 November 11th 07 06:58 PM
Create a button that will date stamp todays date in a cell Tom Meacham Excel Discussion (Misc queries) 3 January 11th 06 01:08 AM
When I open my past invoice it keeps changing date to todays date Stop date changing to todays in Excel Excel Worksheet Functions 2 October 7th 05 04:54 PM


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