Turtleman10
Technical User
I need to read whats in all text boxe's on a spreadsheet. The Textboxes were created using excel not vba (insert/textbox). Im pretty sure its not an OLELbject. I tried using this code to find it and It did not see them. any help would be great
Sub textboxes()
Dim oleObj As OLEObject
For Each oleObj In ActiveSheet.OLEObjects
If oleObj.OLEType = xlOLEControl Then
If Left(oleObj.progID, 14) = "Forms.TextBox." Then
Set oleTxtbox = oleObj.Object
sCollect = sCollect & oleTextbox.Text
End If
End If
Next
End Sub
Sub textboxes()
Dim oleObj As OLEObject
For Each oleObj In ActiveSheet.OLEObjects
If oleObj.OLEType = xlOLEControl Then
If Left(oleObj.progID, 14) = "Forms.TextBox." Then
Set oleTxtbox = oleObj.Object
sCollect = sCollect & oleTextbox.Text
End If
End If
Next
End Sub