ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Count Textboxes and other objects (https://www.excelbanter.com/excel-programming/399037-count-textboxes-other-objects.html)

Dana[_3_]

Count Textboxes and other objects
 
Is there any way that you can count the number of textboxes and other
drawing objects in a sheet using c# or VB from an application and change
their contents?






joel

Count Textboxes and other objects
 
Dana: this code should work


Sub count_boxes()

Count = 0
For Each myshape In ActiveSheet.Shapes
If myshape.Type = msoTextBox Then
Count = Count + 1
End If
Next myshape

End Sub

"Dana" wrote:

Is there any way that you can count the number of textboxes and other
drawing objects in a sheet using c# or VB from an application and change
their contents?








All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com