I need to modify some excel files, if column K contains "AO", "COVER", and column N contains "Tampa"
then any "Riser", "Cone", 'Top slab" (column K) with the same item label (column B) gets the letter J at the end of the value in column D
so in the screenshot below, rows 2 and 3 will be: F14632J and F14824J
I have a partially working code that does exactly this if N contains Tampa, how do I modify my code to have it look for AO COVER in column K ?
then any "Riser", "Cone", 'Top slab" (column K) with the same item label (column B) gets the letter J at the end of the value in column D
so in the screenshot below, rows 2 and 3 will be: F14632J and F14824J
I have a partially working code that does exactly this if N contains Tampa, how do I modify my code to have it look for AO COVER in column K ?
VBA Code:
Sub CityOfTampa()
Dim c As Variant
For Each c In Range("N2:N" & Cells(Rows.Count, 1).End(3).Row)
If c Like "*Tampa*" Or _
c Like "*Tampa*" Then Tampa = c.Offset(, -9)
For Each d In Range("K2:K" & Cells(Rows.Count, 1).End(3).Row)
If d Like "*4'*" And d Like "*Riser*" Or _
d Like "*4'*" And d Like "*Top Slab*" Or _
d Like "*4'*" And d Like "*Cone*" Or _
d Like "*5'*" And d Like "*Cone*" Then
If d.Offset(, 3) Like "*Tampa*" Then
If Right(d.Offset(, -7), 1) <> "J" Then
d.Offset(, -7) = d.Offset(, -7) & "J"
End If
End If
End If
Next d
Next c
End Sub