How to count drawing object (text box) in vba
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
|