Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default dispay dates return in cell

Hi Everyone,

I want to display the dates return in the cell O1. But the following code
writes "sdate1 to sdate2" in the cell instead of something like 2/19/2009 to
2/20/2009. Can anyone help?


Dim sdate1 as Date, sdate2 as Date

sdate1 = Me.StartDate
sdate2 = Me.EndDate

Range("O1").FormulaR1C1 = "sdate1 to sdate2"

Thanks,
Tracktraining
--
Learning
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default dispay dates return in cell

Try this
Range("O1").FormulaR1C1 = sdate1 & " to " & sdate


"tracktraining" wrote:

Hi Everyone,

I want to display the dates return in the cell O1. But the following code
writes "sdate1 to sdate2" in the cell instead of something like 2/19/2009 to
2/20/2009. Can anyone help?


Dim sdate1 as Date, sdate2 as Date

sdate1 = Me.StartDate
sdate2 = Me.EndDate

Range("O1").FormulaR1C1 = "sdate1 to sdate2"

Thanks,
Tracktraining
--
Learning

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default dispay dates return in cell

thanks! that works
--
Learning


"Mike" wrote:

Try this
Range("O1").FormulaR1C1 = sdate1 & " to " & sdate


"tracktraining" wrote:

Hi Everyone,

I want to display the dates return in the cell O1. But the following code
writes "sdate1 to sdate2" in the cell instead of something like 2/19/2009 to
2/20/2009. Can anyone help?


Dim sdate1 as Date, sdate2 as Date

sdate1 = Me.StartDate
sdate2 = Me.EndDate

Range("O1").FormulaR1C1 = "sdate1 to sdate2"

Thanks,
Tracktraining
--
Learning

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default dispay dates return in cell

Hi,

I've got no idea where you are populating the variables sdate1 etc but try
this

Dim sdate1 As Date, sdate2 As Date

sdate1 = Me.StartDate
sdate2 = Me.EndDate
Range("O1").Value = sdate1 & " to " & sdate2


Mike

"tracktraining" wrote:

Hi Everyone,

I want to display the dates return in the cell O1. But the following code
writes "sdate1 to sdate2" in the cell instead of something like 2/19/2009 to
2/20/2009. Can anyone help?


Dim sdate1 as Date, sdate2 as Date

sdate1 = Me.StartDate
sdate2 = Me.EndDate

Range("O1").FormulaR1C1 = "sdate1 to sdate2"

Thanks,
Tracktraining
--
Learning

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
need a function (UDF) return X if 2 dates fall between 2 other dates Chris Salcedo Excel Worksheet Functions 4 September 2nd 09 10:49 PM
How do I change the cell dispay in Excel 2007 from C1:R2 to A2 Mike Nevin Excel Discussion (Misc queries) 1 January 9th 08 11:53 AM
Dispay two values in one cell with the / border separating them. pshofstetter Excel Worksheet Functions 2 June 7th 07 06:12 PM
return array result in cell based on comparing dates Ruthki Excel Worksheet Functions 7 June 30th 05 11:41 PM
Autofilter with vba wont dispay filtered data PPesola Excel Programming 1 June 16th 04 12:30 PM


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