Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Initiate Macro Formula :: Combo Boxes

Hi,

I have a problem that I can resolve in two ways.

1) Is that I have a formula that will run a certain macro only if a
defined cell is a certain number. IE, if A1=1 then run macro1.. if A=2
then run macro2.. if A1=3 then run macro3.. etc

2) I have a combo box with 15+ options in. Is there a way that I can
assign a macro to the invidual options? Or to assign a function to be
carried out if a user clicks on a certain option?

If there is a way to do either of these, then I would be very grateful
if you could explain how. Otherwise, are there any other methods that
could possibly do the same thing?

The scenario is:

I have a combo box with X amount of activities that an organisation
offers. I want a user to navigate the spreadsheet using this combo box.
Clicking on the activity in the combo box will take the user to the
corressponding activity page.

Thanks in advance.


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Combo boxes to change options based on other Combo boxes. Ancient Wolf New Users to Excel 1 March 27th 09 06:29 PM
Initiate a trigger for clearing a list of check boxes? JGarland Excel Worksheet Functions 1 September 18th 08 04:36 PM
Macro that can run combo boxes simonsmith Excel Discussion (Misc queries) 0 June 5th 06 05:00 PM
Selecting subsets using combo boxes or list boxes CLamar Excel Discussion (Misc queries) 0 June 1st 06 07:43 PM
How can a macro automatically initiate uponing a file? kanye Excel Discussion (Misc queries) 5 April 27th 05 11:45 PM


All times are GMT +1. The time now is 05:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"