I want to duplicate the active cell to specific cells on a calendar and everything seems to be right but my code as is does absolutely nothing. I added in a msgbox just to make sure that it is picking up the value of the active cell and it is however it cant seem to print it in the other cells. My code is as follows:
Sub DuplicateEverydayWholeMonth()
Dim locr As Integer
Dim locc As Integer
Dim duccounter As Integer
Dim durcounter As Integer
Dim desc As String
locr = ActiveCell.Row
locc = ActiveCell.Column
duccounter = 4
durcounter = 0
desc = ActiveCell.Value
Do While locr < wcounter
Do While locc <= 17
ActiveCell.Offset(durcounter, duccounter).Value = desc
duccounter = duccounter + 4
locc = locc + 4
Loop
If ActiveCell.Column = 2 Or 6 Or 10 Or 14 Then
locc = 2
ElseIf ActiveCell.Column = 3 Or 7 Or 11 Or 15 Then
locc = 3
ElseIf ActiveCell.Column = 4 Or 8 Or 12 Or 16 Then
locc = 4
ElseIf ActiveCell.Column = 5 Or 9 Or 13 Or 17 Then
locc = 5
Else
MsgBox ("Invalid Cell Selection")
Exit Sub
End If
locr = locr + 10
durcounter = durcounter + 10
Loop
MsgBox (desc)
End Sub
Sub DuplicateEverydayWholeMonth()
Dim locr As Integer
Dim locc As Integer
Dim duccounter As Integer
Dim durcounter As Integer
Dim desc As String
locr = ActiveCell.Row
locc = ActiveCell.Column
duccounter = 4
durcounter = 0
desc = ActiveCell.Value
Do While locr < wcounter
Do While locc <= 17
ActiveCell.Offset(durcounter, duccounter).Value = desc
duccounter = duccounter + 4
locc = locc + 4
Loop
If ActiveCell.Column = 2 Or 6 Or 10 Or 14 Then
locc = 2
ElseIf ActiveCell.Column = 3 Or 7 Or 11 Or 15 Then
locc = 3
ElseIf ActiveCell.Column = 4 Or 8 Or 12 Or 16 Then
locc = 4
ElseIf ActiveCell.Column = 5 Or 9 Or 13 Or 17 Then
locc = 5
Else
MsgBox ("Invalid Cell Selection")
Exit Sub
End If
locr = locr + 10
durcounter = durcounter + 10
Loop
MsgBox (desc)
End Sub