passing text box stiing into variable

  • Thread starter Thread starter Pal
  • Start date Start date
P

Pal

I want to analyze a string of text in a "text box" window.
So by using the cursor to select a range of text, how can I pass that string
into a variable that can be used for other custom functions to update live
in the cells of the sheet as I adjust the input range?
 
Pal,

You could use the INDIRECT function.
eg.
A1: Rob
A2: A1
A3: =INDIRECT(A2) & " was here"

Then as your selection changes, update A2
eg.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A2") = Target.Address
End Sub


Rob
 
Thanks Rob
But I wanted to get the range within a text box - not a range of cells

I have tried using something like
variable = textbox1.text
but it always returns the entire text box contents and not
the cursor highlighted section.
 
Back
Top