View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default How to get variable from a formula

Sub marine()
dq = Chr(34)
MsgBox (Split(Range("B1").Formula, dq)(1))
End Sub

--
Gary''s Student - gsnu200794


"pontitt" wrote:

Hi,

I would like to ask, whether it is possible to get information of a variable
in a formula, I mean:

Cell B1 contains formula:

=SPEC("Green","Apple",98),

is that possible somehow to reach the middle parameter of the function, that
is "Apple"?

Is there any VBA function like:

needed = Cells(1,2).Formula.Parameter(2)

Thanks in advance