Y
Yossy
I have following code that automatically adjust date every month. The date
format in column is January. I need help in making the date January 2009. My
date gets adjusted every month by the code. So next month will be February.
Currently if I put January 2009 in the column and run the code, I get Error
"Type mismatch" becos the code only recognises Month and not Month and year.
I want the code to recognize Month and Year where I have January 2009 so this
way it will automatically update to February 2009 and so on every month. Thus
After December it should increase the year too.
All Help totally appreciated. Thanks
CurrentMonth = Month(DateValue(c.Offset(1, 0) & _
" 1 " & Year(Date)))
If CurrentMonth = 12 Then
NextMonth = "January"
Else
NextMonth = Format(DateValue((CurrentMonth + 1) & _
"/1/" & Year(Date)), "mmmm")
End If
NewCell.Offset(1, 0).Value = NextMonth
format in column is January. I need help in making the date January 2009. My
date gets adjusted every month by the code. So next month will be February.
Currently if I put January 2009 in the column and run the code, I get Error
"Type mismatch" becos the code only recognises Month and not Month and year.
I want the code to recognize Month and Year where I have January 2009 so this
way it will automatically update to February 2009 and so on every month. Thus
After December it should increase the year too.
All Help totally appreciated. Thanks
CurrentMonth = Month(DateValue(c.Offset(1, 0) & _
" 1 " & Year(Date)))
If CurrentMonth = 12 Then
NextMonth = "January"
Else
NextMonth = Format(DateValue((CurrentMonth + 1) & _
"/1/" & Year(Date)), "mmmm")
End If
NewCell.Offset(1, 0).Value = NextMonth