I have this code that counts the total number of item "EYEBOLTS", adds 1 additional row to the end of the excel to show the qty of the EYEBOLTS and some other information
(see screenshot below)
Now we added "EYEBOLTS 2" and "EYEBOLTS 3" to our excel files, so I will need this code to also count those
Each file will only contain one of the three items, so we will still just be adding one additional row to the files.
for EYEBOLTS 2 the offset(,1).Value will be F09721
for EYEBOLTS 3 the offset(,1).Value will be F09722
any help is greatly appreciated !
(see screenshot below)
Now we added "EYEBOLTS 2" and "EYEBOLTS 3" to our excel files, so I will need this code to also count those
Each file will only contain one of the three items, so we will still just be adding one additional row to the files.
for EYEBOLTS 2 the offset(,1).Value will be F09721
for EYEBOLTS 3 the offset(,1).Value will be F09722
any help is greatly appreciated !
VBA Code:
Sub Eyebolts()
lr2 = lr + 1
Set c = ws1.Range("C" & lr2)
With c
.Offset(, -2).Value = .Offset(-1, -2).Value
.FormulaR1C1 = "=COUNTIF(R2C11:R" & lr & "C11,""EYEBOLTS"")"
.Value = .Value
.Offset(, -1).Value = "!"
.Offset(, 1).Value = "F09720"
.Offset(, 6).Value = "Purchased"
.Offset(, 8).Value = "EYEBOLT"
.EntireRow.Font.Bold = True
End With
If ws1.Range("C" & i3).Value Like "*0*" Then
ws1.Rows(lr2).Delete
End If
End Sub