Hey guys,
I could use some help with the following logic. I have been able to define the count of rows with "x" below but I can't seem to refer back to it correctly. I would like to create a loop that will search the cell in column H for a string, then put a certain string in the same row for column I (see example 2 for my recorded and simplified code).
1. define last row. code I'm using:
x = Range("H2").End(xlDown).Offset(-1, 0).Row
2. if H2 contains "cam" make I2 say "cam charges" and copy it down the column as applicable
Range("I2").FormulaR1C1 = "=IF(ISNUMBER(SEARCH(""CAM"",RC[-1])),""CAM Charges"","""")"
Range("I2").Copy
Range("H2").Select
Selection.End(xlDown).Select
Range("I27751").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Selection.End(xlUp).Select
' filter column to only include blanks
ActiveSheet.Range("$A$1:$J$27751").AutoFilter Field:=9, Criteria1:="="
In the end, what I am hoping to do is create a list of items to run through each row until the last row, for example:
if I2 contains "a" enter value "r" in H2
if I2 contains "b" enter value "r" in H2
if I2 contains "c" enter value "s" in H2
if I2 contains "d" enter value "s" in H2
next row (ex I3)
until last row.
The code I am using isn't scaleable and will be too hard to update.
Does this make any sense?
thanks!
Curbster
Bookmarks