View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Lily Lily is offline
external usenet poster
 
Posts: 28
Default Date Format returned from Userform to Excel worksheet

Thanks Jacob. I tried your suggestion and still got 1/0/1900 on Range C3.
Lily

"Jacob Skaria" wrote:

Try replacing

Sheets("Reactor Water").Select
ActiveSheet.Unprotect
Range("C3") = DateIN
Range("C3").Select
Selection.NumberFormat = "m/d/yyyy"

with

With Sheets("Reactor Water")
.Unprotect
.Range("C3") = DateValue(datein)
.Range("C3").NumberFormat = "m/d/yyyy"
End With


--
Jacob


"Lily" wrote:

Hi,

I have a routine vb where I have a form (RXWfrmDate) with the date
(m/d/yyyy) for the user to pick a date for download to specific cell on the
worksheet.

Sub RXWDate()
Dim DateIN As Date
Application.ScreenUpdating = False
RXWfrmDATE.Show
If frmCANCEL = True Then Exit Sub
ActiveWorkbook.Unprotect
Sheets("Reactor Water").Select
ActiveSheet.Unprotect
Range("C3") = DateIN
Range("C3").Select
Selection.NumberFormat = "m/d/yyyy"
Exit Sub
Application.ScreenUpdating = True
End Sub

However, the date that shows on Range "C3") after user input is 01/00/1900.

What am I missing?

Appreciate any help.

Thanks.

Lily