View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Pass date to cell in spreadsheet


Norman,
your code will produce the wrong result
if a month doesn't have 31 days.
(iso Feb28 it'll give March3)


following will give the last day of the month:

with frmWorkHistory
CellPosition.Value = _
DateSerial(.txtStartYear,.txtStartMonth+1,1)-1
end with

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Norman Jones wrote :

With frmWorkHistory
CellPosition.Value = DateSerial(.txtStartYear.Value, _
Me.txtStartMonth, 31)