Spent hours on this.
I need to use code and not a formula to enter the name of the previous month into a cell.
I can get the current month by custom formatting mmmm and using =now() but this gives current month and is a formula. I may be able to combine the use of a formula and macro but I dont know.
I can get the number of the previous month by using
I can not workout how to convert the number into the name of the month.
Bet someone here can tell me!
smiler44
I need to use code and not a formula to enter the name of the previous month into a cell.
I can get the current month by custom formatting mmmm and using =now() but this gives current month and is a formula. I may be able to combine the use of a formula and macro but I dont know.
I can get the number of the previous month by using
Code:
Private Sub CommandButton1_Click()
Dim LMonth As Integer
LMonth = Month(Now)
Range("b4").Select
Range("b4") = LMonth - 1
End Sub
I can not workout how to convert the number into the name of the month.
Bet someone here can tell me!
smiler44