J
JCIrish
As part of a Sub, I have the following code that I want to use to fill down
worksheet formulas. I’ve defined integer variables for totalRows, lastRow and
lastFilledRow in a defined range, â€StocksFormlas.†The defined range is
(“F8:O40â€). I’ve also defined a “y†variable as Range.
At last run, the returned values for the integer variables are
TotalRows = 33
lastFilledtRow = 14
The first line of code snippet (1), below selects “F14â€. The second line
does the fillDown correctly, but only if I specify the fillDown arguments in
“A1†form. I’ve tried everything I know to accomplish the fillDown using
variables to represent the arguments, so that when the address of the last
filledRow changes it can be used as the first argument of the fillDown
method.
Snippet (2) below obviously doesn’t work but represents an alternative
approach I’ve tried, to no avail. Can someone help me with this? I’m growing
old trying to solve this problem.
Thanks very much
(1)
Range("StocksFormulas").End(xlDown).Select
Range("F14:O30").FillDown
(2)
Range("F" & myLastFilledFormulaRow).Select
Set y = Selection
Range("y", Range("O20")).FillDown
worksheet formulas. I’ve defined integer variables for totalRows, lastRow and
lastFilledRow in a defined range, â€StocksFormlas.†The defined range is
(“F8:O40â€). I’ve also defined a “y†variable as Range.
At last run, the returned values for the integer variables are
TotalRows = 33
lastFilledtRow = 14
The first line of code snippet (1), below selects “F14â€. The second line
does the fillDown correctly, but only if I specify the fillDown arguments in
“A1†form. I’ve tried everything I know to accomplish the fillDown using
variables to represent the arguments, so that when the address of the last
filledRow changes it can be used as the first argument of the fillDown
method.
Snippet (2) below obviously doesn’t work but represents an alternative
approach I’ve tried, to no avail. Can someone help me with this? I’m growing
old trying to solve this problem.
Thanks very much
(1)
Range("StocksFormulas").End(xlDown).Select
Range("F14:O30").FillDown
(2)
Range("F" & myLastFilledFormulaRow).Select
Set y = Selection
Range("y", Range("O20")).FillDown