#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dates


I am trying to select the date from Q2 and place that date in th
header.

How do i correct the statement below to make sure the date is capture
as HDRDATE?

Dim HDRDATE As Date
Set HDRDATE.Value = ("Q2"

--
waynehind
-----------------------------------------------------------------------
waynehinds's Profile: http://www.excelforum.com/member.php...fo&userid=2533
View this thread: http://www.excelforum.com/showthread.php?threadid=38844

  #2   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Dates

you are trying to treat HDRDATE as an object with the set statement. and you
dimmed it as a value

Dim HDRDATE As Date
HDRDATE = range("Q2")

--
When you lose your mind, you free your life.


"waynehinds" wrote:


I am trying to select the date from Q2 and place that date in the
header.

How do i correct the statement below to make sure the date is captured
as HDRDATE?

Dim HDRDATE As Date
Set HDRDATE.Value = ("Q2")


--
waynehinds
------------------------------------------------------------------------
waynehinds's Profile: http://www.excelforum.com/member.php...o&userid=25331
View this thread: http://www.excelforum.com/showthread...hreadid=388444


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Dates

Don't use the 'Set' keyword. 'Set' is used to assign an object to
an object variable declared as the appropriate type.
Change your code to

HDRDATE = Range("Q2").Value


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"waynehinds"
wrote
in message
...

I am trying to select the date from Q2 and place that date in
the
header.

How do i correct the statement below to make sure the date is
captured
as HDRDATE?

Dim HDRDATE As Date
Set HDRDATE.Value = ("Q2")


--
waynehinds
------------------------------------------------------------------------
waynehinds's Profile:
http://www.excelforum.com/member.php...o&userid=25331
View this thread:
http://www.excelforum.com/showthread...hreadid=388444



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dates


Thanks for replies..

I want to now set this value to the date format "mm/dd/yy" and put in
header.

It is currently printing in header but it is printing m/d/yyyy


--
waynehinds
------------------------------------------------------------------------
waynehinds's Profile: http://www.excelforum.com/member.php...o&userid=25331
View this thread: http://www.excelforum.com/showthread...hreadid=388444

  #5   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Dates

try

HDRDATE = format(HDRDATE,"mm/dd/yy")

--
When you lose your mind, you free your life.


"waynehinds" wrote:


Thanks for replies..

I want to now set this value to the date format "mm/dd/yy" and put in
header.

It is currently printing in header but it is printing m/d/yyyy


--
waynehinds
------------------------------------------------------------------------
waynehinds's Profile: http://www.excelforum.com/member.php...o&userid=25331
View this thread: http://www.excelforum.com/showthread...hreadid=388444




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dates


Thanks a lot...That did it

--
waynehind
-----------------------------------------------------------------------
waynehinds's Profile: http://www.excelforum.com/member.php...fo&userid=2533
View this thread: http://www.excelforum.com/showthread.php?threadid=38844

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
Linking computer dates (time) to spreadsheet dates that have formu bigisle Excel Worksheet Functions 3 January 3rd 10 08:05 PM
Stop dates from showing as numbers - when formated as dates JR Excel Discussion (Misc queries) 1 October 29th 08 04:38 PM
Toggle a range of Julian dates to Gregorian Dates and Back PSKelligan Excel Programming 4 May 8th 07 05:51 AM
Identifying unique dates in a range of cells containing dates... cdavidson Excel Discussion (Misc queries) 4 October 13th 06 03:30 PM
need to convert list of dates to count no. of dates by week neowok Excel Worksheet Functions 13 January 30th 06 03:54 PM


All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"