ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extract number from name of cell (https://www.excelbanter.com/excel-programming/287906-extract-number-name-cell.html)

matt

Extract number from name of cell
 
I want to rename a cell that contains a control checkbox. the checkbox is named Checkbox2. I want to rename the cell "Box2". How do I extract the 2 from "Box2" so that I can use this in a loop?

matt

Extract number from name of cell
 
This is an example of what I already have for my checkboxes. I would like to do something like this for my renamed cells such as Box2. Thanks. Mat

Dim nChkNum As Intege

For Each ole In OLEObject
If TypeOf ole.Object Is MSForms.Checkbox The
nChkNum = CInt(Mid$(ole.Name, Len("Checkbox") + 1))


All times are GMT +1. The time now is 09:21 AM.

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