Jaymond Flurrie
Well-known Member
- Joined
- Sep 22, 2008
- Messages
- 921
- Office Version
- 365
- Platform
- Windows
I would like to have a date in label in a way like "8/2011". How do I do the numberformat to there?
I tried like:
but that doesn't seem to work, it just gives the current date "8/8/2011".
Oh and this doesn't have to be in a label. Any container is good enough, as long as I just can copy it on top of a chart (because that way I can get the date exactly where I want on top of a chart (I print the chart out and destroy it, so even if this is pretty ugly way to do it, it still would work).
I tried like:
Code:
Range("A1") = Date
Range("A1").NumberFormat = "m/yyyy"
lblDate.Caption = CStr(Range("A1").Value)
but that doesn't seem to work, it just gives the current date "8/8/2011".
Oh and this doesn't have to be in a label. Any container is good enough, as long as I just can copy it on top of a chart (because that way I can get the date exactly where I want on top of a chart (I print the chart out and destroy it, so even if this is pretty ugly way to do it, it still would work).