Hi. I have a userform I create that has 15 checkboxes.
I am trying to accomplish "if checkbox 1 is true, then create a new sheet named "xyz" for each checkbox.
Here is the code I have that doesn't seem to work. I have tried to modify but no success:
I will add for each checkbox on my userform.
Can anyone tell me what I am doing wrong?
I am trying to accomplish "if checkbox 1 is true, then create a new sheet named "xyz" for each checkbox.
Here is the code I have that doesn't seem to work. I have tried to modify but no success:
VBA Code:
Sub Create_Pages()
dim wb = this workbook
with wb
If CheckBox1.Value = True Then
sheets.add "xyz"
End If
end with
End Sub
I will add for each checkbox on my userform.
Can anyone tell me what I am doing wrong?