dim ClaimStartDate as long
claimstartdate = dateserial(cboSDYear,CboCSDMonth,cboCSDDay)
with range("a1")
.value = claimstartdate
.numberformat = "yyyy/mm/dd" 'or whatever you want
end with
=====
By building the string the way you did (with the slashes in the code, you ended
up with a string that excel would interpret according to its rules (and windows
settings).
By making it a real value (datesearial), there isn't any doubt what you want.
===
Ps. Did you look at that calendar control?
Sami82 wrote:
Hi again,
I have taken on your suggestion of having 3 drop down boxes for the
dates, in the order dd (cboCSDDay) mm(cboCSDMonth ) yyyy(cboCSDYear)
ClaimStartDate = cboCSDDay & "/" & cboCSDMonth & "/" & cboCSDYear
MsgBox ClaimStartDate
Range("A1").Value = ClaimStartDate
In the message box the date comes out around the right way, but when it
is pasted in the sheet it is around the wrong way again? How can i
correct this?
Thank you
--
Sami82
------------------------------------------------------------------------
Sami82's Profile: http://www.excelforum.com/member.php...o&userid=27111
View this thread: http://www.excelforum.com/showthread...hreadid=335941
--
Dave Peterson