View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Code instead of foumula.

You still need to use the formula.

Just use code to change the formula itself

ans = Inputbox("Enter the last two digits for 04-##")
ans = Trim(ans)
if len(ans) < 2 or not isnumeric(ans) then
msgbox "Invalid entry"
exit sub
End if
sStr = Range("B9").formula
sStr = left(sStr,42) & ans & right(str,16)
Range("B9").Formula = sStr

--
Regards,
Tom Ogilvy




"Erik" wrote in message
...
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