Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello! I am a little stuck on a project I am working on and a little new a macro programing... I have multiple macros that will search my spreadsheet, each on designed to search for a specific Name and copy the entire row relatin to that instance of that name to a new sheet along with all othe instances of that name. So, for instance, I can pull all the "Bobs" ou of my data and they will be stored on a new sheet. What I would like to do is have a Combo Box that displays all of th names where each name is linked to the specific Macro. So I can pul the box down, select "Bob" and the "Get Bob" macro runs, and if select "Dave" the "Get Dave" macro runs. The problem is I am unsure of how to do this... I can create the Comb Box, and assign a macro, but can only assign one macro, thus making i so that every name I choose uses "Get Bob"... ![]() Anyone know a way to possibly code the links to make it so that i works correctly? Or anything? Is what I want even possible? Cause I dont want a bunch of buttons i at all possible :( Thanks a bunch -- Gryswyn ----------------------------------------------------------------------- Gryswynd's Profile: http://www.excelforum.com/member.php...fo&userid=3655 View this thread: http://www.excelforum.com/showthread.php?threadid=56309 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub MacroCaller()
Select Case ComboBox1.Value Case "Bob" Call GetBob Case "Dave" Call GetDave Case else Call Nobody End Select Does that help any? Die_Another_Day "Gryswynd" wrote in message ... Hello! I am a little stuck on a project I am working on and a little new at macro programing... I have multiple macros that will search my spreadsheet, each one designed to search for a specific Name and copy the entire row relating to that instance of that name to a new sheet along with all other instances of that name. So, for instance, I can pull all the "Bobs" out of my data and they will be stored on a new sheet. What I would like to do is have a Combo Box that displays all of the names where each name is linked to the specific Macro. So I can pull the box down, select "Bob" and the "Get Bob" macro runs, and if I select "Dave" the "Get Dave" macro runs. The problem is I am unsure of how to do this... I can create the Combo Box, and assign a macro, but can only assign one macro, thus making it so that every name I choose uses "Get Bob"... ![]() Anyone know a way to possibly code the links to make it so that it works correctly? Or anything? Is what I want even possible? Cause I dont want a bunch of buttons if at all possible :( Thanks a bunch! -- Gryswynd ------------------------------------------------------------------------ Gryswynd's Profile: http://www.excelforum.com/member.php...o&userid=36559 View this thread: http://www.excelforum.com/showthread...hreadid=563092 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If all you macros perform similar functions, just pass the name. e.g.
Function FindData (argName as string) as boolean dim foundrange as range set foundrange=Range("rngData").Find(argName,,...etc) If Not foundrange is nothing then 'perform your actions based on foundrange FindData =true Else FindData = false End if Then in the Combobox1_Click event Dim RetVal as Boolean RetVal=FindData (Combobox1.Text) If RetVal=False then Msgbox "No data for " & Combobox1.Text NickHk "Gryswynd" wrote in message ... Hello! I am a little stuck on a project I am working on and a little new at macro programing... I have multiple macros that will search my spreadsheet, each one designed to search for a specific Name and copy the entire row relating to that instance of that name to a new sheet along with all other instances of that name. So, for instance, I can pull all the "Bobs" out of my data and they will be stored on a new sheet. What I would like to do is have a Combo Box that displays all of the names where each name is linked to the specific Macro. So I can pull the box down, select "Bob" and the "Get Bob" macro runs, and if I select "Dave" the "Get Dave" macro runs. The problem is I am unsure of how to do this... I can create the Combo Box, and assign a macro, but can only assign one macro, thus making it so that every name I choose uses "Get Bob"... ![]() Anyone know a way to possibly code the links to make it so that it works correctly? Or anything? Is what I want even possible? Cause I dont want a bunch of buttons if at all possible :( Thanks a bunch! -- Gryswynd ------------------------------------------------------------------------ Gryswynd's Profile: http://www.excelforum.com/member.php...o&userid=36559 View this thread: http://www.excelforum.com/showthread...hreadid=563092 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
combo reference on another combo box for picking address etc. | Excel Worksheet Functions | |||
Excel VBA Combo Box Populating dependent on other combo box choices | Excel Programming | |||
Filtered list for Combo Box ListFillRange - Nested Combo Boxes | Excel Programming | |||
"Combo Box - getting control combo box to stick in place in worksh | Excel Discussion (Misc queries) | |||
"Combo Box - getting control combo box to stick in place in worksh | Excel Discussion (Misc queries) |