date/year method

  • Thread starter Thread starter JohnE
  • Start date Start date
J

JohnE

I am wanting the current month and year to show in range
(A6) thru the use of code and a button. But, I am having
difficulty using the month(date) as it returns a number
for the month. I haven't tried to add the year until I
get the month figured out.
How do I go about getting the Month - Year into a cell
from code?
Thanks for any assistance.
*** John
 
Hi
one way:
sub month_year()
dim rng as range
set rng = activesheet.range("A6")
rng.value = now
rng.numberformat = "MMM - YYYY"
end sub

assign a button to this macro
 
Back
Top