Worksheet event for tick box

  • Thread starter Thread starter David Berry
  • Start date Start date
D

David Berry

Would be very grateful for any help on this one..

I'm trying to create a form that will bring up a sheet in excel when
the "tick to continue" tick box is checked.

I've read the bits on worksheet events but haven't got a clue how to
adapt to my use - only ever used the macro recorder and done bits of
changes to existing visual basic.

Basically, I would like to have the form select 1 of 3 different sheets
depending upon the value of a cell, say A1, which is defined by other
entries made earlier and I'm thinking of using the tickbox as the
trigger but any other option considered!

many thanks

David
 
David,

I seriously suggest you not use a tick box (checkbox) as a trigger to
continue. Generally, most programmers would use a button labelled "Continue"
or "Next", and for the sake of consistency amongst applications, I would
urge you to use a button.

Not only is it more consistent, but easier to write the code e.g.
assume the trigger values in cell A1 are 1, 2 or 3.

Sub cmdContinue_Click()
select Case Range("A1").value
Case 1
Sheets("Sheet1").select
Case 2
Sheets("Sheet2").select
Case 3
Sheets("Sheet3").select
Case else
msgbox("The value in Cell A1 is not within the appropriate
values, please recheck your selections and click Continue again")
End Select
End Sub

Steve
 
Back
Top