PDA

View Full Version : Sleeper: CheckBoxes



TheWireNut
11-14-2023, 09:16 PM
Ive been having a heck of a time trying to get a simple check box code to work. Essentially I'm trying to use a checkbox to create another sheet and move certain cell information to specific cells in the new sheet. I'm starting small just to get the add sheet code to work and then build on that but nothing is working. Here's what I've been trying:


Sub CheckBoxFromHell()
If Worksheets("Schedule").CheckBoxes("CheckBox1").Value = True Then
Sheets.Add.Name = "Transformer"
End If
End Sub

So far, I can't get the add sheet command to work on this particular spreadsheet. I copied a table from another sheet I didn't create to a new one in the event that there were settings on the original sheet causing errors (protected portions?).

georgiboy
11-15-2023, 01:52 AM
Welcome to the forum,

If it is an ActiveX checkbox then you can try the below:

Sub CheckBoxFromHell()
If Worksheets("Schedule").CheckBox1.Value = True Then
Sheets.Add.Name = "Transformer"
End If
End Sub

Aussiebear
12-07-2023, 03:47 AM
Sadly it seems "TheWireNut" has succumbed to his injuries..... Make sure you keep yer eyes on dem pesky checkboxes from here on in.

Paul_Hossler
12-07-2023, 08:28 AM
Sadly it seems "TheWireNut" has succumbed to his injuries..... Make sure you keep yer eyes on dem pesky checkboxes from here on in.




:rotlaugh: