Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default ASSIG MACROS TO DROP DOWN LIST

Hello and happy new year 2007 to you all,

I am working on a excel book for which I have created a series of
macros which will help me to short the info according to different
criteria, such as client name etc...

The idea is that the users can easily access the information they are
looking for. The next step is something I do not know how to go about.

I want to create a drop down list with, for instance, all the clients
and assign to each one its respective macros, in such a way that when
the user selects its client the corresponding macro will run.

I am fairly new to excel and know nothing about programming...could
somebody give me a hand or tell me if this is possible

Thank you in advance,

Aisak

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default ASSIG MACROS TO DROP DOWN LIST

You could create a combobox from the forms toolbar, link it to a cell
(right-click it, Format ControlControl, and set the Cell link to a cell),
and then in the assigned macro, check that cell

Sub myMacro()
With Activesheet.Range("A1")
If .Value = "value 1" Then
Call macro1
ElseIf .Value = "value 1" Then
Call macro2
'etc.
End If
End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
ups.com...
Hello and happy new year 2007 to you all,

I am working on a excel book for which I have created a series of
macros which will help me to short the info according to different
criteria, such as client name etc...

The idea is that the users can easily access the information they are
looking for. The next step is something I do not know how to go about.

I want to create a drop down list with, for instance, all the clients
and assign to each one its respective macros, in such a way that when
the user selects its client the corresponding macro will run.

I am fairly new to excel and know nothing about programming...could
somebody give me a hand or tell me if this is possible

Thank you in advance,

Aisak



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default ASSIG MACROS TO DROP DOWN LIST

Hello Bob,

Thank you for your answer. Sorry, but I quite not understand the
procedure..I have created the combobox as you state with all the months
(Jan to December) and have linked it to cell I2. When I select January
that cell shows the value "1" and december "12".

I have twelve Macros named from "January" to "December". Do I have to
create a new macro with the script you suggest below and instead of
.....Range("A1) i have to wirte ("I2")?

Thank you for your time!!!!!

Aisak


Bob Phillips ha escrit:
You could create a combobox from the forms toolbar, link it to a cell
(right-click it, Format ControlControl, and set the Cell link to a cell),
and then in the assigned macro, check that cell

Sub myMacro()
With Activesheet.Range("A1")
If .Value = "value 1" Then
Call macro1
ElseIf .Value = "value 1" Then
Call macro2
'etc.
End If
End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
ups.com...
Hello and happy new year 2007 to you all,

I am working on a excel book for which I have created a series of
macros which will help me to short the info according to different
criteria, such as client name etc...

The idea is that the users can easily access the information they are
looking for. The next step is something I do not know how to go about.

I want to create a drop down list with, for instance, all the clients
and assign to each one its respective macros, in such a way that when
the user selects its client the corresponding macro will run.

I am fairly new to excel and know nothing about programming...could
somebody give me a hand or tell me if this is possible

Thank you in advance,

Aisak


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default ASSIG MACROS TO DROP DOWN LIST

Sorry mate, I forgot it returned the index, not the value.

You could modify the code to check the index

Sub myMacro()
With Activesheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February
'etc.
End If
End Sub


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
oups.com...
Hello Bob,

Thank you for your answer. Sorry, but I quite not understand the
procedure..I have created the combobox as you state with all the months
(Jan to December) and have linked it to cell I2. When I select January
that cell shows the value "1" and december "12".

I have twelve Macros named from "January" to "December". Do I have to
create a new macro with the script you suggest below and instead of
....Range("A1) i have to wirte ("I2")?

Thank you for your time!!!!!

Aisak


Bob Phillips ha escrit:
You could create a combobox from the forms toolbar, link it to a cell
(right-click it, Format ControlControl, and set the Cell link to a
cell),
and then in the assigned macro, check that cell

Sub myMacro()
With Activesheet.Range("A1")
If .Value = "value 1" Then
Call macro1
ElseIf .Value = "value 1" Then
Call macro2
'etc.
End If
End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
ups.com...
Hello and happy new year 2007 to you all,

I am working on a excel book for which I have created a series of
macros which will help me to short the info according to different
criteria, such as client name etc...

The idea is that the users can easily access the information they are
looking for. The next step is something I do not know how to go about.

I want to create a drop down list with, for instance, all the clients
and assign to each one its respective macros, in such a way that when
the user selects its client the corresponding macro will run.

I am fairly new to excel and know nothing about programming...could
somebody give me a hand or tell me if this is possible

Thank you in advance,

Aisak




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default ASSIG MACROS TO DROP DOWN LIST

Thank you Rob,

You are being quite helpful, but sadly I am not...I wrote the script in
a new Macro (the one I assigned to the combobox) but it doesnt work. It
gives me a compilation error.

As I said I do not have a clue about programmin but I am obviously
doing smth wrong;

This is what I actually wrote in the macros

Sub A()
'
' A Macro
' Macro grabada el 02/01/2007 por Cruises9
'

'
With ActiveSheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February

End Select
End Sub


I´d appreacite if you could advice if what I´ve done is an insult to
myself

Cheers



Bob Phillips ha escrit:
Sorry mate, I forgot it returned the index, not the value.

You could modify the code to check the index

Sub myMacro()
With Activesheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February
'etc.
End If
End Sub


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
oups.com...
Hello Bob,

Thank you for your answer. Sorry, but I quite not understand the
procedure..I have created the combobox as you state with all the months
(Jan to December) and have linked it to cell I2. When I select January
that cell shows the value "1" and december "12".

I have twelve Macros named from "January" to "December". Do I have to
create a new macro with the script you suggest below and instead of
....Range("A1) i have to wirte ("I2")?

Thank you for your time!!!!!

Aisak


Bob Phillips ha escrit:
You could create a combobox from the forms toolbar, link it to a cell
(right-click it, Format ControlControl, and set the Cell link to a
cell),
and then in the assigned macro, check that cell

Sub myMacro()
With Activesheet.Range("A1")
If .Value = "value 1" Then
Call macro1
ElseIf .Value = "value 1" Then
Call macro2
'etc.
End If
End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
ups.com...
Hello and happy new year 2007 to you all,

I am working on a excel book for which I have created a series of
macros which will help me to short the info according to different
criteria, such as client name etc...

The idea is that the users can easily access the information they are
looking for. The next step is something I do not know how to go about.

I want to create a drop down list with, for instance, all the clients
and assign to each one its respective macros, in such a way that when
the user selects its client the corresponding macro will run.

I am fairly new to excel and know nothing about programming...could
somebody give me a hand or tell me if this is possible

Thank you in advance,

Aisak





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default ASSIG MACROS TO DROP DOWN LIST

Did you assign the macro A to the combobox, again by right-clicking it and
selecting Assign Macro from the menu?

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
ups.com...
Thank you Rob,

You are being quite helpful, but sadly I am not...I wrote the script in
a new Macro (the one I assigned to the combobox) but it doesnt work. It
gives me a compilation error.

As I said I do not have a clue about programmin but I am obviously
doing smth wrong;

This is what I actually wrote in the macros

Sub A()
'
' A Macro
' Macro grabada el 02/01/2007 por Cruises9
'

'
With ActiveSheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February

End Select
End Sub


I´d appreacite if you could advice if what I´ve done is an insult to
myself

Cheers



Bob Phillips ha escrit:
Sorry mate, I forgot it returned the index, not the value.

You could modify the code to check the index

Sub myMacro()
With Activesheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February
'etc.
End If
End Sub


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
oups.com...
Hello Bob,

Thank you for your answer. Sorry, but I quite not understand the
procedure..I have created the combobox as you state with all the months
(Jan to December) and have linked it to cell I2. When I select January
that cell shows the value "1" and december "12".

I have twelve Macros named from "January" to "December". Do I have to
create a new macro with the script you suggest below and instead of
....Range("A1) i have to wirte ("I2")?

Thank you for your time!!!!!

Aisak


Bob Phillips ha escrit:
You could create a combobox from the forms toolbar, link it to a cell
(right-click it, Format ControlControl, and set the Cell link to a
cell),
and then in the assigned macro, check that cell

Sub myMacro()
With Activesheet.Range("A1")
If .Value = "value 1" Then
Call macro1
ElseIf .Value = "value 1" Then
Call macro2
'etc.
End If
End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
ups.com...
Hello and happy new year 2007 to you all,

I am working on a excel book for which I have created a series of
macros which will help me to short the info according to different
criteria, such as client name etc...

The idea is that the users can easily access the information they are
looking for. The next step is something I do not know how to go
about.

I want to create a drop down list with, for instance, all the clients
and assign to each one its respective macros, in such a way that when
the user selects its client the corresponding macro will run.

I am fairly new to excel and know nothing about programming...could
somebody give me a hand or tell me if this is possible

Thank you in advance,

Aisak




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default ASSIG MACROS TO DROP DOWN LIST

Also, you are missing an End With

Sub A()
'
' A Macro
' Macro grabada el 02/01/2007 por Cruises9
'
With ActiveSheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February
End Select
End With '<===========
End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
ups.com...
Thank you Rob,

You are being quite helpful, but sadly I am not...I wrote the script in
a new Macro (the one I assigned to the combobox) but it doesnt work. It
gives me a compilation error.

As I said I do not have a clue about programmin but I am obviously
doing smth wrong;

This is what I actually wrote in the macros

Sub A()
'
' A Macro
' Macro grabada el 02/01/2007 por Cruises9
'

'
With ActiveSheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February

End Select
End Sub


I´d appreacite if you could advice if what I´ve done is an insult to
myself

Cheers



Bob Phillips ha escrit:
Sorry mate, I forgot it returned the index, not the value.

You could modify the code to check the index

Sub myMacro()
With Activesheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February
'etc.
End If
End Sub


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
oups.com...
Hello Bob,

Thank you for your answer. Sorry, but I quite not understand the
procedure..I have created the combobox as you state with all the months
(Jan to December) and have linked it to cell I2. When I select January
that cell shows the value "1" and december "12".

I have twelve Macros named from "January" to "December". Do I have to
create a new macro with the script you suggest below and instead of
....Range("A1) i have to wirte ("I2")?

Thank you for your time!!!!!

Aisak


Bob Phillips ha escrit:
You could create a combobox from the forms toolbar, link it to a cell
(right-click it, Format ControlControl, and set the Cell link to a
cell),
and then in the assigned macro, check that cell

Sub myMacro()
With Activesheet.Range("A1")
If .Value = "value 1" Then
Call macro1
ElseIf .Value = "value 1" Then
Call macro2
'etc.
End If
End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
ups.com...
Hello and happy new year 2007 to you all,

I am working on a excel book for which I have created a series of
macros which will help me to short the info according to different
criteria, such as client name etc...

The idea is that the users can easily access the information they are
looking for. The next step is something I do not know how to go
about.

I want to create a drop down list with, for instance, all the clients
and assign to each one its respective macros, in such a way that when
the user selects its client the corresponding macro will run.

I am fairly new to excel and know nothing about programming...could
somebody give me a hand or tell me if this is possible

Thank you in advance,

Aisak




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default ASSIG MACROS TO DROP DOWN LIST

Thank you Bob,

That really did the job!!! Great and thank you for your time!!!

PS: What I found out is that to include the code I had to click on the
combobox and then "assign macro" and then "New Macro".

It is working nicely

Thanks

Bob Phillips ha escrito:

Also, you are missing an End With

Sub A()
'
' A Macro
' Macro grabada el 02/01/2007 por Cruises9
'
With ActiveSheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February
End Select
End With '<===========
End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
ups.com...
Thank you Rob,

You are being quite helpful, but sadly I am not...I wrote the script in
a new Macro (the one I assigned to the combobox) but it doesnt work. It
gives me a compilation error.

As I said I do not have a clue about programmin but I am obviously
doing smth wrong;

This is what I actually wrote in the macros

Sub A()
'
' A Macro
' Macro grabada el 02/01/2007 por Cruises9
'

'
With ActiveSheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February

End Select
End Sub


I´d appreacite if you could advice if what I´ve done is an insult to
myself

Cheers



Bob Phillips ha escrit:
Sorry mate, I forgot it returned the index, not the value.

You could modify the code to check the index

Sub myMacro()
With Activesheet.Range("I2")
Select Case .Value
Case 1: Call January
Case 2: Call February
'etc.
End If
End Sub


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
oups.com...
Hello Bob,

Thank you for your answer. Sorry, but I quite not understand the
procedure..I have created the combobox as you state with all the months
(Jan to December) and have linked it to cell I2. When I select January
that cell shows the value "1" and december "12".

I have twelve Macros named from "January" to "December". Do I have to
create a new macro with the script you suggest below and instead of
....Range("A1) i have to wirte ("I2")?

Thank you for your time!!!!!

Aisak


Bob Phillips ha escrit:
You could create a combobox from the forms toolbar, link it to a cell
(right-click it, Format ControlControl, and set the Cell link to a
cell),
and then in the assigned macro, check that cell

Sub myMacro()
With Activesheet.Range("A1")
If .Value = "value 1" Then
Call macro1
ElseIf .Value = "value 1" Then
Call macro2
'etc.
End If
End Sub

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CaOrAl" wrote in message
ups.com...
Hello and happy new year 2007 to you all,

I am working on a excel book for which I have created a series of
macros which will help me to short the info according to different
criteria, such as client name etc...

The idea is that the users can easily access the information they are
looking for. The next step is something I do not know how to go
about.

I want to create a drop down list with, for instance, all the clients
and assign to each one its respective macros, in such a way that when
the user selects its client the corresponding macro will run.

I am fairly new to excel and know nothing about programming...could
somebody give me a hand or tell me if this is possible

Thank you in advance,

Aisak



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
Default to Top of Drop Down List Anita Excel Worksheet Functions 5 December 6th 06 11:22 PM
drop down list of a drop down list Hapitaron10 Excel Worksheet Functions 3 June 2nd 06 11:03 PM
Limit drop down list and linking to other info Intuit Excel Worksheet Functions 13 February 2nd 06 09:48 PM
changing value of a cell by selecting an item from a drop down list Bobby Mir Excel Worksheet Functions 6 June 8th 05 08:33 PM
Pull unique names for drop down list [email protected] Excel Discussion (Misc queries) 3 February 1st 05 10:23 PM


All times are GMT +1. The time now is 07:27 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"