Hi,
Depending on the text in column B I need to assign values to column D. these values need to be incremental. so if B1 = A it is given the value 4, and then if B5 = A it should be valued as 5 and so forth, I have got the following code that assigns the value but it doesn't add as I need. To keep the code shorter and as I have a list of different texts for Column B.
Depending on the text in column B I need to assign values to column D. these values need to be incremental. so if B1 = A it is given the value 4, and then if B5 = A it should be valued as 5 and so forth, I have got the following code that assigns the value but it doesn't add as I need. To keep the code shorter and as I have a list of different texts for Column B.
Code:
Sub names()
Dim Add As Variant
Dim l, m
Row = Worksheets("Names").Range("Rows")
For l = 2 To 74
For m = 1 To 7
Add = Row(m, 2)
Add = Add + 1
If Cells(l, 2) = Row(m, 1) Then
Cells(l, 4) = Add
End If
Next m
Next l
End Sub