PDA

View Full Version : Solved: Tweeking formula



Klartigue
09-12-2011, 12:13 PM
Sub Maturity()
'
' Lookup Maturity

Windows("sunrise.csv").Activate
Application.Run "BLPLinkReset"

Range("AB7").Resize(Range("A2").End(xlDown).Row - 1).FormulaR1C1 = _
"=VLOOKUP(RC[-27],'[Sunrise Perform Input 8.31.2011.xls]Sheet1'!R1:R65536,10,FALSE)"


End Sub

how do i get this formula to fill down all AB cells that are present? Could be AB2 to AB20, could be AB2 to AB100. etc..

mancubus
09-13-2011, 01:48 AM
hi.
try...



Dim LastRow As Long

'row num of last cell with data, column A:
LastRow = Cells(Rows.Count, "A").End(xlUp).Row

Range("AB2:AB" & LastRow).FormulaR1C1 = _
"=VLOOKUP(RC[-27],'[Sunrise Perform Input 8.31.2011.xls]Sheet1'!R1:R65536,10,FALSE)"

mancubus
09-13-2011, 01:58 AM
ps: not sure if this part is true: Sheet1!R1:R65536
maybe Sheet1!C1:C256 or Sheet1'!R1C1:R65536C256