View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JP Ronse JP Ronse is offline
external usenet poster
 
Posts: 174
Default HOW TO SELECT THE TEXT BOX?

Hi,

Do you mean a textbox from the drawing toolbar?

Try

Activesheet.shapes.count, this should return the number of shapes in the
worksheet.

Next, you can get the names of the shapes with

activesheet.shapes(x).name with x is a number between 1 and the result of
the .count instruction.

To select: activesheet.shapes(x).select

With
selection.characters.text you can read or set the text.

Something as

Sub AAAA
Dim str As String

With ActiveSheet
.Shapes("Text Box 3").Select
str = Selection.Characters.Text
.Shapes("Text Box 2").Select
Selection.Characters.Text = str
End With

End Sub


should do what you want.

Wkr,

JP

"ezil" wrote in message
...
My application needs copying text box contents (eg.text box 1) from sheet
1
to antoher text box in sheet 2. For that i tried to select text box but i
found it is not possible. What is the code for this task? (The text box is
ordinary text box and not the text box from active control or form
control)