rhombus4
Well-known Member
- Joined
- May 26, 2010
- Messages
- 586
- Office Version
- 365
- 2016
- Platform
- Windows
I've added to an existing macro so that checkboxes which have been ticked or Option buttons which have been pressed are then unticked.
I can do them individualy heres a sample
ActiveSheet.Shapes("Check Box 2103").Select
With Selection
.Value = xlOff
.LinkedCell = ""
.Display3DShading = True
End With
ActiveSheet.Shapes("Check Box 2104").Select
With Selection
.Value = xlOff
.LinkedCell = ""
.Display3DShading = True
End With
The above works fine, but I have alot of checkboxes and when I do them all the macro is very long.
I tried to record a macro (below) and do two at once which recorded fine but when I ran it I got an error " unable to set the value property of the DrawingObjects Class.
ActiveSheet.Shapes("Check Box 2103").Select
ActiveSheet.Shapes.Range(Array("Check Box 2103", "Check Box 2104")).Select
With Selection
.Value = xlOff
.LinkedCell = ""
.Display3DShading = True
End With
Range("A1").Select
End Sub
Is it possible to group them all like when you want to clear cells you can just list them in one line or range then clear contents. e.g if i had checkboxes 2101 to 2140. ALso is it possible to rename the checkbox number as alot of them are really random numbers!
I can do them individualy heres a sample
ActiveSheet.Shapes("Check Box 2103").Select
With Selection
.Value = xlOff
.LinkedCell = ""
.Display3DShading = True
End With
ActiveSheet.Shapes("Check Box 2104").Select
With Selection
.Value = xlOff
.LinkedCell = ""
.Display3DShading = True
End With
The above works fine, but I have alot of checkboxes and when I do them all the macro is very long.
I tried to record a macro (below) and do two at once which recorded fine but when I ran it I got an error " unable to set the value property of the DrawingObjects Class.
ActiveSheet.Shapes("Check Box 2103").Select
ActiveSheet.Shapes.Range(Array("Check Box 2103", "Check Box 2104")).Select
With Selection
.Value = xlOff
.LinkedCell = ""
.Display3DShading = True
End With
Range("A1").Select
End Sub
Is it possible to group them all like when you want to clear cells you can just list them in one line or range then clear contents. e.g if i had checkboxes 2101 to 2140. ALso is it possible to rename the checkbox number as alot of them are really random numbers!