rsutton1981
New Member
- Joined
- Mar 9, 2016
- Messages
- 47
- Office Version
- 365
- Platform
- Windows
Hi,
I have date in dd/mm/yyyy in column AY. I need he data as month only. I tried creating some VBA to do this but it does not work. I can work with either AY being changed to just show the month or have the month shown in AZ. Please help
I have date in dd/mm/yyyy in column AY. I need he data as month only. I tried creating some VBA to do this but it does not work. I can work with either AY being changed to just show the month or have the month shown in AZ. Please help
Code:
Dim rng As Range
Dim row As Range
Dim cell As Range
Set rng = Range("ay15:ay25")
For Each row In rng.Rows
For Each cell In row.Cells
Sheets("data input").Range("ay" & rng.row) = Format(Date, "mmm")
Next cell
Next row