Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cell date formatting 1

Status
Not open for further replies.

JTBorton

Technical User
Jun 9, 2008
345
DE
I am trying to format my cells with dates to dd-mmm. I tried the follwing code but VBA laughs, makes yo-momma jokes at me then moves to the next step without changing a thing.

(CellDate - a Date variable)

If IsDate(.Cells(V, 5)) Then
CellDate = .Cells(V, 5)
CellDate = Format(CellDate, "dd-mmm")
'.Cells(V, 5) = CellDate Didnt Work
'.Cells(V, 5) = Format(.Cells(V, 5), "dd-mmm") Didnt Work
.Cells(V, 5).NumberFormat = Date 'Doesnt Work Either
End If
 





Did you try formatting on the sheet with your macro recoder on?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
What about this ?
If IsDate(.Cells(V, 5)) Then
.Cells(V, 5).NumberFormat = "dd-mmm"
End If

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top