ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet event for tick box (https://www.excelbanter.com/excel-programming/278504-worksheet-event-tick-box.html)

David Berry[_2_]

Worksheet event for tick box
 
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Steve Smallman

Worksheet event for tick box
 
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


"David Berry" wrote in message
...
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 11:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com