I'm not sure how to modify that formula, so i put the whole thing in as a macro. It filled all my cells in column B with "c", up til the last row where column A has a value.
And yeah, the "a" is just a test actually. The real one would be a bunch of IF statements which gives me another headache since the company's Excel 2003 only supports 7 nested IFs and I gotta figure a way round that.
I tried recording the macro a different way and I think it worked a bit better. I didn't use autofill, but copied and pasted into visible cells. My code looks like this:
Sub Macro1()
Range("I1".Select
ActiveCell.FormulaR1C1 = "count = 1"
Rows("1:1").Select
Range("C1").Activate
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="1"
Sheets("sg").Select
Range("I531").Select
ActiveCell.FormulaR1C1 = "=RC[-4]"
Range("I531").Select
Selection.Copy
Range("I531").Select
Range(Selection, Selection.End(xlDown)).Select
Range("I531:I52056").Select
Selection.SpecialCells(xlCellTypeVisible).Select
ActiveSheet.Paste
Range("J531").Select
Application.CutCopyMode = False
Selection.AutoFilter
End Sub
Doesn't feel like an elegant way, and definitely has one problem: The I531 and I52056 cells won't always be those numbers. I'd need them replaced by "First visible cell of Column I" and "Last visible cell of Column I which has a non-blank in Column H".