ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   running a macro by a click (https://www.excelbanter.com/excel-programming/278878-running-macro-click.html)

Nazeer

running a macro by a click
 
I have a macro that I want to run everytime a user select
an option from a drop down list. What the macro does is,
it takes the user to a specific cell depending upon their
selection.
Currently, the macro can only be run either manually or by
clicking on a toolbar button. But I want the macro to
automatically run as soon as the user makes a selection.

Any ideas?

Thanks.

Tom Ogilvy

running a macro by a click
 
If you are using a combobox from the control toolbox toolbar, then use the
click event.

--
Regards,
Tom Ogilvy

"Nazeer" wrote in message
...
I have a macro that I want to run everytime a user select
an option from a drop down list. What the macro does is,
it takes the user to a specific cell depending upon their
selection.
Currently, the macro can only be run either manually or by
clicking on a toolbar button. But I want the macro to
automatically run as soon as the user makes a selection.

Any ideas?

Thanks.




Nazeer

running a macro by a click
 
Thanks, Tom. How do I use the click event. Can you provide
specific details. I am not familiar with events.

thanks.


-----Original Message-----
If you are using a combobox from the control toolbox

toolbar, then use the
click event.

--
Regards,
Tom Ogilvy

"Nazeer" wrote in message
...
I have a macro that I want to run everytime a user

select
an option from a drop down list. What the macro does is,
it takes the user to a specific cell depending upon

their
selection.
Currently, the macro can only be run either manually or

by
clicking on a toolbar button. But I want the macro to
automatically run as soon as the user makes a selection.

Any ideas?

Thanks.



.


Nazeer

running a macro by a click
 
How do I use the click event. Can you provide more details
as I am not very familiar with events?

Thanks.

-----Original Message-----
If you are using a combobox from the control toolbox

toolbar, then use the
click event.

--
Regards,
Tom Ogilvy

"Nazeer" wrote in message
...
I have a macro that I want to run everytime a user

select
an option from a drop down list. What the macro does is,
it takes the user to a specific cell depending upon

their
selection.
Currently, the macro can only be run either manually or

by
clicking on a toolbar button. But I want the macro to
automatically run as soon as the user makes a selection.

Any ideas?

Thanks.



.


Tom Ogilvy

running a macro by a click
 
after you place the combobox on the worksheet, right click on it and select
view code.

You should be in the click event.

Put the code you want to run there.
--
Regards,
Tom Ogilvy

Nazeer wrote in message
...
Thanks, Tom. How do I use the click event. Can you provide
specific details. I am not familiar with events.

thanks.


-----Original Message-----
If you are using a combobox from the control toolbox

toolbar, then use the
click event.

--
Regards,
Tom Ogilvy

"Nazeer" wrote in message
...
I have a macro that I want to run everytime a user

select
an option from a drop down list. What the macro does is,
it takes the user to a specific cell depending upon

their
selection.
Currently, the macro can only be run either manually or

by
clicking on a toolbar button. But I want the macro to
automatically run as soon as the user makes a selection.

Any ideas?

Thanks.



.




Tim Richardson[_2_]

running a macro by a click
 
"Nazeer" wrote in message ...
How do I use the click event. Can you provide more details
as I am not very familiar with events?

Thanks.

-----Original Message-----
If you are using a combobox from the control toolbox

toolbar, then use the
click event.

--
Regards,
Tom Ogilvy

"Nazeer" <nbutt@newsameric

If you don't understand Tom's answer, you are a beginner. You haven't
read the visual basic help yet either, I would say. Events are certain
things that can happen in Excel. They are defined in advance, one
event is "right click" on a control, like your pop-down menu. When an
event happens, Excel will look for a special subroutine named after
the event, and if it finds code, it will be run. This is how you do
what you want. It is well documented in help. The Visual Basic editor
will show you all the events associated with an object when you are
editing a code module belonging to the object (above the text editing
screen in VB there are two pop-up lists. Change the left one to be the
object you are editing, and the right one will show you the available
event subroutines, at least in my version of Excel.


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com