M
Mark
I am attempting to set up a program in Excel/VBA that
will take raw data that will format it, find the last
row, and Subtotal the column. Everything works except
the SUBTOTAL function.
I have a routine that starts at the top row and works
downward checking for the first empty cell. As it moves
down it tracks the Row by the varialbe "LineNumber" in a
loop with the line "LineNumber=LineNuber+1". When it
reachs the first empty cell I want to use
the "LineNumber" variable as the first arguement. The
Column will be constant in this application. I will then
Copy and Paste to other columns.
The code from recording a Macro is:
ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,R[-2235]C:R[-1]C)"
I have attemptd inserting the variable "LineNumber" with:
ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,R[-LineNumber]C:R[-
1]C)"
This does not work.
The SUBTOTAL range will always have a top row of 6 as
this is just below the column label. I am also using
AUTOFILTER's in the process to manipulate, then copy and
paste information.
I have attempted to "automate" SUBTOTAL's for a long time
and have yet to find the correct code. Please Help!
Thank you in advance,
Mark
will take raw data that will format it, find the last
row, and Subtotal the column. Everything works except
the SUBTOTAL function.
I have a routine that starts at the top row and works
downward checking for the first empty cell. As it moves
down it tracks the Row by the varialbe "LineNumber" in a
loop with the line "LineNumber=LineNuber+1". When it
reachs the first empty cell I want to use
the "LineNumber" variable as the first arguement. The
Column will be constant in this application. I will then
Copy and Paste to other columns.
The code from recording a Macro is:
ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,R[-2235]C:R[-1]C)"
I have attemptd inserting the variable "LineNumber" with:
ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,R[-LineNumber]C:R[-
1]C)"
This does not work.
The SUBTOTAL range will always have a top row of 6 as
this is just below the column label. I am also using
AUTOFILTER's in the process to manipulate, then copy and
paste information.
I have attempted to "automate" SUBTOTAL's for a long time
and have yet to find the correct code. Please Help!
Thank you in advance,
Mark