For a data set of variable number of columns and rows, trying to figure VBA to put a formula into first row for each column (preferably if it could also omit columns that contain text, but would be fine if it can't).
Formula needs to be calculating subtotals, showing only results for visible rows and not rows that are filtered out.
Such formula would be something like this =SUBTOTAL(109,F3:F50000). But the F3:F50000 needs to be variable for each column and number of rows, but can start with row 3 for each of the columns.
And color the cells in first row with those formulas yellow
Aside from this formula, no idea on the VBA syntax and how to make this happen. For some of you out there, I know -- it's a cinch.
Formula needs to be calculating subtotals, showing only results for visible rows and not rows that are filtered out.
Such formula would be something like this =SUBTOTAL(109,F3:F50000). But the F3:F50000 needs to be variable for each column and number of rows, but can start with row 3 for each of the columns.
And color the cells in first row with those formulas yellow
Aside from this formula, no idea on the VBA syntax and how to make this happen. For some of you out there, I know -- it's a cinch.