Link to home
Start Free TrialLog in
Avatar of Wilder1626
Wilder1626Flag for Canada

asked on

Date and time format issue

Hello all

I'm trying to add the date and time of the day in the same cell in this macro:
If Not r Is Nothing Then
  If r.Value > "" And r.Offset(, 28) = "" Then
  
    r.Offset(, 26).Value = Application.UserName
    r.Offset(, 27).NumberFormat = Date & " " & "[$-F400]h:mm AM/PM"
    r.Offset(, 27).Value = Date

   
  End If
End If

Open in new window


But the result in the cell is only: 21-10-2011.

How can i make it look like 21-10-2011  08:29 AM?

Thanks for your help
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forgot the next line:
r.Offset(, 27).Value = Now

Open in new window

Avatar of Wilder1626

ASKER

perfect.

Thanks, it work