View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
EagleOne EagleOne is offline
external usenet poster
 
Posts: 68
Default Help with VBA InStr() function

2003 & 2007


ActiveCell.Formula ='P:\DMB\[MyWorkBook.xls]Allocation '!$U$77*1000000-
_
'P:\DMB\[MyWorkBook.xls]Allocation '!$U$85

Current VBA code to isolate the first cell reference follows:

BeginStr = Left(ActiveCell.Formula, InStr(ActiveCell.Formula, "!") +
1))
CellRefStr = InStr(BeginStr, ActiveCell.Formula, "*")
? CellRefStr yields $U$77 but only if the Operator is "*"

1) How best can I code "*" in the above InStr() so as to substitute it
with ANY
Operator? i.e., Operators = Array("/", "+", "-", "[*]", "",
"<", "=")
2) How then to yield $U$85 ?

Ultimately my End Game is to isolate the each Cell Reference (could be
many!)
after each WorkBook Worksheet reference in the ActiveCell.Formula.

Because there could be many Cell References my initial approach above
may
well be inappropriate or the long way around the barn.

Any help appreciated greatly!

EagleOne