ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert formulas (https://www.excelbanter.com/excel-programming/429156-insert-formulas.html)

francis

Insert formulas
 
How do I insert formulas into various ranges to the last rows where column A
have its last data,
assuming that I want to have the following formula from row 2 to last row
with data in column A, let say A200
column B2 down, insert =VLOOKUP(C2,SI!$A$2:$F$200,5,0)
column C2 down, insert =VLOOKUP(E2,OLT!$A$2:$B$48,2,0)
column D2 down, insert =VLOOKUP(O2,Rate!$C$2:$I$15,7)

TIA
--
Hope this is helpful

Pls click the Yes button below if this post provide answer you have asked

Thank You

cheers, francis

Am not a greek but an ordinary user trying to assist another


Per Jessen

Insert formulas
 
Hi

Try this:

Sub InsertFormulas()
LastRow = Range("A2").End(xlDown).Row
Range("B2").Formula = "=VLOOKUP(C2,SI!$A$2:$F$200,5,0)"
Range("C2").Formula = "=VLOOKUP(E2,OLT!$A$2:$B$48,2,0)"
Range("D2").Formula = "=VLOOKUP(O2,Rate!$C$2:$I$15,7)"

Range("B2:D" & LastRow).FillDown
End Sub

Best regards,
Per

"Francis" skrev i meddelelsen
...
How do I insert formulas into various ranges to the last rows where column
A
have its last data,
assuming that I want to have the following formula from row 2 to last row
with data in column A, let say A200
column B2 down, insert =VLOOKUP(C2,SI!$A$2:$F$200,5,0)
column C2 down, insert =VLOOKUP(E2,OLT!$A$2:$B$48,2,0)
column D2 down, insert =VLOOKUP(O2,Rate!$C$2:$I$15,7)

TIA
--
Hope this is helpful

Pls click the Yes button below if this post provide answer you have asked

Thank You

cheers, francis

Am not a greek but an ordinary user trying to assist another




All times are GMT +1. The time now is 07:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com