Hi,
This vlookup is taking me 7 minutes to run - way too slow, anyone have any ideas for improving the speed?
The following code is designed to leave a formula in a cell in the active worksheet. The formula references a key cell in this active workbook (cell A11 but referred to in the following code as R[-18]C1) and then takes the value from that key cell to look up a value in a worksheet in a different workbook. Currently the code is set up to leave formulas in 52 cells in the active workbook but eventually I want to expand that to over 100 cells. (Previously I had the other worksheet as just another tab in my active workbook and worked off the indirect function in excel and it took less than 1 second to look up all the values. But now I need to look it up from the other workbook. I think a potential solution would be to import the entire row first into my active worksheet and then set up a simple macro to distribute the values from the active worksheet - if so, how do you import/export entire rows using VBA code?)
Windows("Copy of Mkt Curve Tool Working Copy SW v3.xlsm").Activate
Range("AKExpPrem1").Select
Range("AKExpPrem1").FormulaR1C1 = _
"=VLOOKUP(R[-18]C1,'[2012 to 2016 bound new test VBA.xlsm]2015 CLASH'!R7C1:R500C112, Column('[2012 to 2016 bound new test VBA.xlsm]2015 CLASH'!C60), FALSE)"
Daniel
This vlookup is taking me 7 minutes to run - way too slow, anyone have any ideas for improving the speed?
The following code is designed to leave a formula in a cell in the active worksheet. The formula references a key cell in this active workbook (cell A11 but referred to in the following code as R[-18]C1) and then takes the value from that key cell to look up a value in a worksheet in a different workbook. Currently the code is set up to leave formulas in 52 cells in the active workbook but eventually I want to expand that to over 100 cells. (Previously I had the other worksheet as just another tab in my active workbook and worked off the indirect function in excel and it took less than 1 second to look up all the values. But now I need to look it up from the other workbook. I think a potential solution would be to import the entire row first into my active worksheet and then set up a simple macro to distribute the values from the active worksheet - if so, how do you import/export entire rows using VBA code?)
Windows("Copy of Mkt Curve Tool Working Copy SW v3.xlsm").Activate
Range("AKExpPrem1").Select
Range("AKExpPrem1").FormulaR1C1 = _
"=VLOOKUP(R[-18]C1,'[2012 to 2016 bound new test VBA.xlsm]2015 CLASH'!R7C1:R500C112, Column('[2012 to 2016 bound new test VBA.xlsm]2015 CLASH'!C60), FALSE)"
Daniel