Hi, y'all. I'm writing a macro for Excel 2003. I need to write a formula, "=IF(S3=""12043"",1,0)", to a cell at "V3", then copy that formula down the "V" column, with the cell referenced in the formula "S3" iterating up ("S4", "S5", "S6", etc), ending at the last row which has data (this row number is set with a variable, "usedrowsagain"). The code I'm using is:
With Sheets("BOM")
.Range("V3:V10" & .Cells(usedrowsagain).End(xlUp).Row).Formula = "=IF(S3=""12043"",1,0)"
End With
Can someone explain to me what this code is doing? The result is, it fills in the formula, correctly, but only to row 101. The number of rows it fills in changes as I change the "V10" in the "Range" setting ("V3:V10"), and always fills in ten times as many cells as the "V10", i.e. it fills in 101 if it's set "V10", 181 if it's set "V18", etc. Can someone help me with this? Thanx.
Bookmarks