Referring Objects

  • Thread starter Thread starter Squid
  • Start date Start date
S

Squid

I have a checkbox on sheet1, which I plan to give the user an option to
whether or not to hide some columns beforePrint. How to I refer this
checkbox object to be used in the Workbook_BeforePrint event?

TIA
Mike
 
sheet1.CheckBox1.Value

where Sheet1 is the codename of the sheet with the checkbox or

Worksheets("Sheet1").Checkbox1.value

where Sheet1 is the tab name of the sheet with the checkbox.

This is for a checkbox from the control toolbox toolbar.

for a checkbox from the forms toolbar

If Worksheets("sheet1").Checkboxes("Check Box 1").Value = xlOn then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top