I have a code that works but It only fills in one cell
It needs to check if the cell is filled in. If it is the case then it need to fill in the next cell. but it can't fill no more than 3 cells next to each other.
Because each month have in the worksheet 3 cells that can be filled in.
Code
Sub details_agents_fill_in()
Dim mydate As Variant
Dim title As String: title = ActiveWorkbook.Worksheets(1).Range("C8")
mydate = Month(DTPicker1)
If mydate = 1 Then GoTo 1
If mydate = 2 Then GoTo 2
If mydate = 3 Then GoTo 3
If mydate = 4 Then GoTo 4
If mydate = 5 Then GoTo 5
If mydate = 6 Then GoTo 6
If mydate = 7 Then GoTo 7
If mydate = 8 Then GoTo 8
If mydate = 9 Then GoTo 9
If mydate = 10 Then GoTo 10
If mydate = 11 Then GoTo 11
If mydate = 12 Then GoTo 12
1: ActiveCell.Offset(0, 4).Value = title
Exit Sub
2: ActiveCell.Offset(0, 7).Value = title
Exit Sub
3: ActiveCell.Offset(0, 10).Value = title
Exit Sub
4: ActiveCell.Offset(0, 13).Value = title
Exit Sub
5: ActiveCell.Offset(0, 16).Value = title
Exit Sub
6: ActiveCell.Offset(0, 19).Value = title
Exit Sub
7: ActiveCell.Offset(0, 22).Value = title
Exit Sub
8: ActiveCell.Offset(0, 25).Value = title
Exit Sub
9: ActiveCell.Offset(0, 28).Value = title
Exit Sub
10: ActiveCell.Offset(0, 31).Value = title
Exit Sub
11: ActiveCell.Offset(0, 34).Value = title
Exit Sub
12: ActiveCell.Offset(0, 37).Value = title
Exit Sub
End Sub
Display More