View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NoelH NoelH is offline
external usenet poster
 
Posts: 10
Default excel input date format

Hi
Thanks in advance for any help.
I have this small macro
Dim myDateP1
myDateP1 = InputBox("Enter START date for report PERIOD in dd-mm-yy
format")
If myDateP1 < "" Then
If IsDate(myDateP1) Then
' MsgBox "Continue the macro"
' Selection.NumberFormat = "dd/mm/yyyy"
' ActiveCell.Offset(0, 2).Range("A1").Select
Selection.FormulaR1C1 = myDateP1
Range("n4").Select
Selection.FormulaR1C1 = "=(r[-3]c)"
' Selection.NumberFormat = "dd/mm/yyyy"
Else
MsgBox "You did not enter a date"
End If
End If

seeking the user to input a date, in the format dd/mm/yy This part work.
However when the date is placed into the cell the format becomes mm/dd/yy.

I know I'm doing something wrong and it might be the new year blues.

Is anyone able to guide me. as you can see by the rem I've tryied formating
the cells.

Thanks
Noel