View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default vlookup + indirect formula

Maybe you can do it in pieces...

First change the formulas to text
Select the range with the formulas
edit|Replace
what: = (equal sign)
with: $$$$$
replace all

Then do the first change
edit|replace
what: 'sample'
with: indirect(fcst&"!"
replace all

Maybe with should be:
indirect("'"&fcst&"'!"
???

then once more (or multiple times more):
edit|replace
what: ,2,false)
with: ),2,false)
replace all

(If you have formulas that bring back other columns, you'll want to repeat this
step:
edit|replace
what: ,3,false)
with: ),3,false)
replace all

As many times as necessary.

Then change your text back to formulas:
edit|replace
what: $$$$$
with: =
replace all

I'd only do a few cells to make sure the formulas were ok. Then select the
remainder of the range and replace all.



smart.daisy wrote:

Hi,
I have dozens of formula like this:
VLOOKUP($A22,'sample'!$A$302:$Z$302,2,FALSE), except $A$302:$Z$302 might
change like $A$50:$Z$51, picking up from different area.
Now I want to replace above formula like this:
VLOOKUP($G13,INDIRECT(Fcst&"!$b$20:$z$30"),2,FALSE ) but I won't change area.
Because there are so many formula, I want to change them in a batch, I try to
use replace (ctrl+R), but it doesn't work because I only want to replace
'sample'!$ with INDIRECT(Fcst&"!
I got error message because I can't replace including ")

Is there a way to change this formula in a batch?


--

Dave Peterson