Thread
:
use variable value in a range reference?
View Single Post
#
3
Posted to microsoft.public.excel.programming
Don Guillett[_2_]
external usenet poster
Posts: 1,522
use variable value in a range reference?
Sub fillitdown()
'Range("e1").AutoFill Range("e1:e4")
dim lr as long
lr = Cells(Rows.Count, "e").End(xlUp).Row
Cells(lr, "e").AutoFill Cells(lr, "e").Resize(4)
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"JCIrish" wrote in message
...
My code is
Dim myformulaTotalRows As Integer
Dim mylastFormulaRow As Integer
With Range("formulaCells") 'named range
totalRows = .Rows.Count
lastRow = .Rows(totalRows).Row
End With
myformulaTotalRows = totalRows
mylastFormulaRow = lastRow
Is there a way to use "mylastFormulaRow" in a statement like
Range("C6").select where the row number 6 can be replaced by
"mylastFormulaRow"?
I want to use the selected cell as the first argument in a .filldown
statement
Thanks for any help
Reply With Quote
Don Guillett[_2_]
View Public Profile
Find all posts by Don Guillett[_2_]