Hello. I have a list of codes with a column next to it that has units used.
My goal is to find a particular code in the column and THEN multiply it's current value (units) by 50 (replacing the previous value).
It is setup as ColA has codes ColB has Units, ColC - codes, ColD - units, etc.
I have been successful in using a nested 'for' loop but I was wondering if it would be faster to use autofilter and specialcells(xlCellTypeVisible).
But then I'm not sure how to reference the adjacent column to do the calculation. Something to the effect of looping through the visible cells I suppose.
I have something like this so far:
Dim rg As Range
Set rg = Range("B4")
rg.AutoFilter Field:=2, Criteria1:="J1642"
For Each cell In rg.SpecialCells(xlCellTypeVisible)
' calculate the value of the adjacent cell by multiplying it by 50
Next cell
Any help is much appreciated. Thank you.
My goal is to find a particular code in the column and THEN multiply it's current value (units) by 50 (replacing the previous value).
It is setup as ColA has codes ColB has Units, ColC - codes, ColD - units, etc.
I have been successful in using a nested 'for' loop but I was wondering if it would be faster to use autofilter and specialcells(xlCellTypeVisible).
But then I'm not sure how to reference the adjacent column to do the calculation. Something to the effect of looping through the visible cells I suppose.
I have something like this so far:
Dim rg As Range
Set rg = Range("B4")
rg.AutoFilter Field:=2, Criteria1:="J1642"
For Each cell In rg.SpecialCells(xlCellTypeVisible)
' calculate the value of the adjacent cell by multiplying it by 50
Next cell
Any help is much appreciated. Thank you.