Extract number from name of cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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))
 
Back
Top