Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am a newbie at VBA (I have written a few small macros) and was hoping
someone might be able to help with this task. I have 3 worksheets: worksheet A, worksheet B, and worksheet C. On worksheet A I have 3 checkbox controls and a button that I have pulled from the VBA controls toolbar. What I want is to have a macro do the following: If the first 2 checkboxes are checked and the button is pushed, take the user to worksheet B, if the first and third checkboxes are checked and the button is pushed, take the user to worksheet C. In the long run there will be a lot more checkboxes and combinations on what sheets to go to but I thought this example would give me enough to modify as I went along. Is this tough to do? Any help would be greatly appreciated. TIA! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This would be a start:
Sub Button4_Click() If ActiveSheet.CheckBoxes("Check Box 1").Value = xlOn Then If ActiveSheet.CheckBoxes("Check Box 2").Value = xlOn Then Worksheets("Sheet2").Activate ElseIf ActiveSheet.CheckBoxes("Check Box 3").Value = xlOn Then Worksheets("Sheet3").Activate End If End If End Sub -- Jim "Jenn" wrote in message ... |I am a newbie at VBA (I have written a few small macros) and was hoping | someone might be able to help with this task. | I have 3 worksheets: worksheet A, worksheet B, and worksheet C. | On worksheet A I have 3 checkbox controls and a button that I have pulled | from the VBA controls toolbar. What I want is to have a macro do the | following: | | If the first 2 checkboxes are checked and the button is pushed, take the | user to worksheet B, if the first and third checkboxes are checked and the | button is pushed, take the user to worksheet C. | | In the long run there will be a lot more checkboxes and combinations on what | sheets to go to but I thought this example would give me enough to modify as | I went along. | Is this tough to do? Any help would be greatly appreciated. | TIA! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks! I think that will work perfectly! Appreciate the fast response.
"Jim Rech" wrote: This would be a start: Sub Button4_Click() If ActiveSheet.CheckBoxes("Check Box 1").Value = xlOn Then If ActiveSheet.CheckBoxes("Check Box 2").Value = xlOn Then Worksheets("Sheet2").Activate ElseIf ActiveSheet.CheckBoxes("Check Box 3").Value = xlOn Then Worksheets("Sheet3").Activate End If End If End Sub -- Jim "Jenn" wrote in message ... |I am a newbie at VBA (I have written a few small macros) and was hoping | someone might be able to help with this task. | I have 3 worksheets: worksheet A, worksheet B, and worksheet C. | On worksheet A I have 3 checkbox controls and a button that I have pulled | from the VBA controls toolbar. What I want is to have a macro do the | following: | | If the first 2 checkboxes are checked and the button is pushed, take the | user to worksheet B, if the first and third checkboxes are checked and the | button is pushed, take the user to worksheet C. | | In the long run there will be a lot more checkboxes and combinations on what | sheets to go to but I thought this example would give me enough to modify as | I went along. | Is this tough to do? Any help would be greatly appreciated. | TIA! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checkbox functionality | Excel Discussion (Misc queries) | |||
Can't Get Objects To Work In A Protected Worksheet | Excel Worksheet Functions | |||
Cannot select checkbox to delete it from a spreadsheet | Excel Discussion (Misc queries) | |||
how do I protect a worksheet and still use a checkbox control | Excel Worksheet Functions | |||
Question when Copying an Existing Worksheet | Excel Worksheet Functions |