I have searched extensively for a solution to this but nothing I've tried works automatically. The goal is that anytime text is manually entered in column C, the macro will find the last number used in column CG, increment by 1 if less than 6 and then enter that value on the active row. This works when run manually, but I cannot figure out how to automatically trigger when data is entered in column C.
Sub Counting()
Dim rng As Range
Dim text As String
Dim counterNumber As Integer
Dim counter As Range
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets("Sheet1")
Set rng = ws.Cells(ActiveCell.Row, 3)
text = ""
If rng <> text Then
Set counter = rng
Set counter = counter.Offset(-1, 82) 'Finds the last value entered in the Counter column
counterNumber = counter 'Temporary storage for counter number
If counterNumber = 6 Then 'Restarts counting loop
counterNumber = 0
End If
counterNumber = counterNumber + 1 'Increase counter number by 1
Set counter = counter.Offset(1, 0) 'Returns to the active row
counter = counterNumber 'Inputs the updated counter number
End If
End Sub