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


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Combo Box Help

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Combo Box Help

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
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
combo reference on another combo box for picking address etc. kbjin Excel Worksheet Functions 1 December 8th 06 03:29 PM
Excel VBA Combo Box Populating dependent on other combo box choices ikabodred Excel Programming 1 March 15th 06 03:16 PM
Filtered list for Combo Box ListFillRange - Nested Combo Boxes DoctorG Excel Programming 3 February 23rd 06 12:15 PM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 1 February 16th 05 02:05 AM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 0 February 15th 05 07:45 PM


All times are GMT +1. The time now is 12:03 PM.

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

About Us

"It's about Microsoft Excel"