View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
lykwid[_2_] lykwid[_2_] is offline
external usenet poster
 
Posts: 1
Default Initiate Macro Formula :: Combo Boxes

Seems as though I worked out a method. If anyone has a similar problem,
I'll post how I did it.

I used a normal combo box which I assume you know how to do. I set the
cell link to G8, which display which option is selected in the combo
box.

I then created a button, which I used the caption of "Go" and placed it
next to the combo box.

The code I used for the button is:

Sub Button6_Click()

If Range("G8").Value = 1 Then
Sheets("Aerobics").Select
ElseIf Range("G8").Value = 2 Then
Sheets("Main").Select
ElseIf Range("G8").Value = 3 Then
Sheets("Members").Select
Else
End If

End Sub

---------------- below is explanation

Sub Button6_Click()

If Range("G8").Value = 1 Then
If the number 1 is in cell G8, then do the next line

Sheets("Aerobics").Select
Go to sheet called "Aerobics"

ElseIf Range("G8").Value = 2 Then
If the number 2 is in cell G8, then do the next line

Sheets("Main").Select
Go to sheet called "Main"

ElseIf Range("G8").Value = 3 Then
If the number 3 is in cell G8, then do the next line

Sheets("Members").Select
Go to sheet called "Members"

Else
End If

End Sub

This seems to work, although I have only just used it once.


---
Message posted from http://www.ExcelForum.com/