View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default How to count drawing object (text box) in vba

Ah so! You are using the Forms Toolbar textbox.


"geniusideas" wrote in message
...
Dear Gary and JL,

Sorry, Both also not working but I found the answer as below

Option Explicit

Sub TextBoxCount()
Dim myDocument As Worksheet
Dim x As Integer
Dim sh As Object
Dim txtb As String

Set myDocument = ActiveSheet
x = 1
For Each sh In myDocument.Shapes
If sh.Type = msoTextBox Then
sh.Select
txtb = Selection.Characters.Text
Cells(x, 1) = txtb
x = x + 1
End If
Next
Range("A1").Select
End Sub

Thanks..anyway