View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JohnB JohnB is offline
external usenet poster
 
Posts: 53
Default Date Problem in VBA

Hi All
I'm importing data from an Access query in to an Excel pivot table and as I
many of these imports to do I set the following constants in a standatd
module.
Private Const YearStart As Date = #1/4/2007#
Private Const YearEnd As Date = #31/3/2008#

The Dates I need are 1st April 2007 to 31st March 2008 however the date
#1/4/2007# is changed by Excel to #4/1/2007# so that the pivottable show for
the 1st january 2007. I've chacked the Windows XP Regional setting for the
date and are dd/mm/yyyy which is ok. Is there another setting somewhere? Any
suggesstions as to why the date #1/4/2007# is being changed?

TIA
johnb