Q: VBA Help: Iterating through another columns value and creating a separate unique counter *see description* Basically this code is reading column 2 which is JP's, and placing JT1,JT2 etc in another column but the catch is this, whenever a new JP is present in the next row, it'll restart the counter and always output JT1, but when there are multiple of the same JP it'll start a counter.
An example is like this:
JP1 --> JT1, JP2 --> JT1, JP2 --> JT2
Notice how when there is a unique JP it always is JT1, but once there is multiple of the same JP, the JT starts a counter like JT1, JT2, JT3 etc.
I am having trouble right now with this any help would be great.
Dim JobTask as String
Dim w1 as Workbook
Dim s1 as Worksheet
Dim row1 as Integer
Dim iteration as Integer

set w1 = ThisWorkbook
set s1 = w1.Sheets("Job Plan Sort")

For row1 = 9 To 16
JobPlan = s1.Cells(row1, 2).Value
JobTask = s1.Cells(row1, 3).Value


For iteration = row1 To 16
 If s1.Cells(iteration, 2) <> s1.Cells(iteration + 1, 2) Then

For j = row1 To (counter + row1)
                
                    s1.Cells(j, 3).Value = ("JT" + CStr(jtCounter))
                    
                Next j
                row1 = row1 + counter
                jtCounter = jtCounter + 1
                
                Exit For
                
         End If




            
     Next iteration
   



     Next row1

HERE IS SAMPLE OF OUTPUT AS REQUESTED


A: Something like:
I2: ="JT"&COUNTIF($H$2:H2,H2)


