Forum Discussion
Macro for a month
try pasting this into your code editor:
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+m
'
ActiveCell.Formula = Month(Date) + 1
If ActiveCell.Value = 1 Then
ActiveCell.Value = "January Invoice"
End If
If ActiveCell.Value = 2 Then
ActiveCell.Value = "Febuary Invoice"
End If
If ActiveCell.Value = 3 Then
ActiveCell.Value = "March Invoice"
End If
If ActiveCell.Value = 4 Then
ActiveCell.Value = "April Invoice"
End If
If ActiveCell.Value = 5 Then
ActiveCell.Value = "May Invoice"
End If
If ActiveCell.Value = 6 Then
ActiveCell.Value = "June Invoice"
End If
If ActiveCell.Value = 7 Then
ActiveCell.Value = "July Invoice"
End If
If ActiveCell.Value = 8 Then
ActiveCell.Value = "August Invoice"
End If
If ActiveCell.Value = 9 Then
ActiveCell.Value = "September Invoice"
End If
If ActiveCell.Value = 10 Then
ActiveCell.Value = "October Invoice"
End If
If ActiveCell.Value = 11 Then
ActiveCell.Value = "November Invoice"
End If
If ActiveCell.Value = 12 Then
ActiveCell.Value = "December Invoice"
End If
End Sub
- marty007Nov 24, 2021Brass ContributorThank you very much but I think this is beyond my ability. I think I pasted your code in the Microsoft Visual Basic for Applications but I don't know what to do with it. Is this supposed to work in Excel or Outlook. When I enter control-m, nothing happens. I could send a screen print of what I did, if I could send you an attachment.
- Josh_WaldnerNov 24, 2021Brass Contributor
try the attachment. it works only for excel though.
- marty007Nov 24, 2021Brass ContributorOK, thanks. That works.