ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code instead of foumula. (https://www.excelbanter.com/excel-programming/311098-re-code-instead-foumula.html)

sebastienm

Code instead of foumula.
 
When the input box is filled, just assihn the modified formula to the cell.
Assuming A1 is the cell:

newNum = ' number from input box
Range("A1").Formula = "='P:\NAP Office\VT-31 Classes\[VT31 FY 04-" _
& Format(newNum,"00") & ".xls]Tracker'!C9"

You may want to change the Format part with another pattern. The one above
will returns 01, 02, .. 32, for entry 1,2,32.

Regards,
Sebastien


"Erik" wrote:

I have the following formula in a couple of cells and want to use code instead.

='P:\NAP Office\VT-31 Classes\[VT31 FY 04-37.xls]Tracker'!C9

The formula refers to another workbook on another drive. The reason I want
to use code instead is that I want to be able to change the reference at the
04-37 portion of the formula through an input box to other numbers in the
same general format ie. 04-##. Any thoughts?
Erik



All times are GMT +1. The time now is 06:46 AM.

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