Requirement:
I would like to add vba code to place the current month and year in cell A2. So if I am run the vba today March 3, 2015 the cell value will be: MARCH 2015
If I run the vba code on April 9, 2015 it will be : APRIL 2015, and so on
Solution:
Sub test()
With Range("a2")
.Value = Date
.NumberFormat = "mmmm yyyy"
End With
End Sub
Obtained from the OzGrid Help Forum.
Solution provided by jindon.
See also: Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions and Index to new resources and reference sheets
See also:
| How to freeze panes using VBA |
| How to data trim and clean cell values with VBA code |
| How to maximise IE window in VBA |
| How to generate multiple line charts VBA |
| How to create VBA to copy specific column from one sheet to another |
| How to use VBA to returning 5 left digits and pasting to bottom of existing data set |
| How to download a file using VBA |
Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.