dispay dates return in cell

  • Thread starter Thread starter tracktraining
  • Start date Start date
T

tracktraining

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
 
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
 
Back
Top