PC Review


Reply
Thread Tools Rate Thread

Dates in macros

 
 
Zak
Guest
Posts: n/a
 
      15th Jan 2008
How can i tell a macro to look for dates (in format dd/mm/yy) in column X and
change it to mmm-yy (oct 07) format? i did this via format cells but as i am
using a pivot table afterwards the pivot table still some how picks the date
up in its original form as opposed to the new form. so a macro would prob do
the job better.

thanks.
 
Reply With Quote
 
 
 
 
Charles Chickering
Guest
Posts: n/a
 
      15th Jan 2008
Zak, format the entire column as "mmm-yy" and the Pivot Table should display
correctly.
--
Charles Chickering

"A good example is twice the value of good advice."


"Zak" wrote:

> How can i tell a macro to look for dates (in format dd/mm/yy) in column X and
> change it to mmm-yy (oct 07) format? i did this via format cells but as i am
> using a pivot table afterwards the pivot table still some how picks the date
> up in its original form as opposed to the new form. so a macro would prob do
> the job better.
>
> thanks.

 
Reply With Quote
 
Jim Thomlinson
Guest
Posts: n/a
 
      15th Jan 2008
Excel stores dates as a number and then formats that number to look like a
date. By changing the format in the spreadsheet you do not change the
underlying number. So when you create your pivot table it does not pick up
the format it just picks up the number. You need to format the date in the
pivot table. Right click the date and select Field Settings -> Number... and
format the date as necessary.
--
HTH...

Jim Thomlinson


"Zak" wrote:

> How can i tell a macro to look for dates (in format dd/mm/yy) in column X and
> change it to mmm-yy (oct 07) format? i did this via format cells but as i am
> using a pivot table afterwards the pivot table still some how picks the date
> up in its original form as opposed to the new form. so a macro would prob do
> the job better.
>
> thanks.

 
Reply With Quote
 
Zak
Guest
Posts: n/a
 
      15th Jan 2008

Thanks a million, worked fine.


"Jim Thomlinson" wrote:

> Excel stores dates as a number and then formats that number to look like a
> date. By changing the format in the spreadsheet you do not change the
> underlying number. So when you create your pivot table it does not pick up
> the format it just picks up the number. You need to format the date in the
> pivot table. Right click the date and select Field Settings -> Number... and
> format the date as necessary.
> --
> HTH...
>
> Jim Thomlinson
>
>
> "Zak" wrote:
>
> > How can i tell a macro to look for dates (in format dd/mm/yy) in column X and
> > change it to mmm-yy (oct 07) format? i did this via format cells but as i am
> > using a pivot table afterwards the pivot table still some how picks the date
> > up in its original form as opposed to the new form. so a macro would prob do
> > the job better.
> >
> > thanks.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros to delete dates jimmadge Windows Vista 0 18th Aug 2010 03:12 PM
MACROS DATES Noe Microsoft Excel Programming 4 27th Dec 2009 11:39 PM
dates in macros Max Scott Microsoft Excel Programming 10 16th Dec 2007 06:11 PM
Using dates in macros zack Microsoft Excel Programming 2 29th Jun 2004 08:47 AM
Filter data by using From and To dates without using Macros tonyfdes Microsoft Excel Worksheet Functions 2 28th Feb 2004 02:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:55 AM.