View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Help with VBA InStr() function


You may want to consider using the precedents and dependents property
of the cell. You can see how I did it in my Formula Map program
in this post... http://tinyurl.com/yedjlw
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


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