View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gary Brown[_6_] Gary Brown[_6_] is offline
external usenet poster
 
Posts: 126
Default How to count drawing object (text box) in vba

Public Sub test_tb()
Dim x As Integer
Dim obj As Object

For Each obj In ActiveSheet.OLEObjects
If TypeOf obj.Object Is MSForms.TextBox Then
x = x + 1
Range("A" & x).Value = obj.Object.Value
End If
Next obj

End Sub

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"geniusideas" wrote:

Hi,

My next project is to count drawing object which is textbox place this
textbox content into cells.
For example:
TextBox1 = My Name
TextBox2 = is
TextBox3 = Micheal Jackson

Final result all these text is inside individual cell
Range(A1) = My Name
Range(A2) = Is
Range(A3) = Micheal Jackson

Please help in vba code.Thanks
Note : number of textbox is umlimited..
Please help
.