Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Invoking a macro from a cell change

Hi

I am trying to run a macro that needs to run whenever the user selects
an entry from a combo box on a chart page. The combo box cell link is
returning the value and I have tried to link to that cell using the
worksheet "Private Sub Worksheet_Change(ByVal Target As Range)".
If the value changes due to the combo box value changing nothing
happens, however if I manually change the value the macro runs.

How do I make this work for me please.....

Thanks in advance

John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Invoking a macro from a cell change

It's really a Chart sheet--not a worksheet with a chart on it?

If that's true, then it's a dropdown from the Forms toolbar, right?

Why not just assign a macro to that dropdown (rightclick on it and choose Assign
Macro).

This worked ok for me:

Option Explicit
Sub testme()

Dim myDD As DropDown
Set myDD = ActiveSheet.DropDowns(Application.Caller)

If myDD.Value < 1 Then
MsgBox "nothing selected"
Else
With myDD
MsgBox .List(.ListIndex)
End With
End If
End Sub




Planner999 wrote:

Hi

I am trying to run a macro that needs to run whenever the user selects
an entry from a combo box on a chart page. The combo box cell link is
returning the value and I have tried to link to that cell using the
worksheet "Private Sub Worksheet_Change(ByVal Target As Range)".
If the value changes due to the combo box value changing nothing
happens, however if I manually change the value the macro runs.

How do I make this work for me please.....

Thanks in advance

John


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Invoking a macro from a cell change

Why not initiate the macro from the change event assocated with the Combo Box
instead of the linked cell? The linked cell will not fire in this case, but
the combo box will work. I would post an example for you but I don't know if
your combo box is from the Forms Toolbar or the Control Toolbox...
--
HTH...

Jim Thomlinson


"Planner999" wrote:

Hi

I am trying to run a macro that needs to run whenever the user selects
an entry from a combo box on a chart page. The combo box cell link is
returning the value and I have tried to link to that cell using the
worksheet "Private Sub Worksheet_Change(ByVal Target As Range)".
If the value changes due to the combo box value changing nothing
happens, however if I manually change the value the macro runs.

How do I make this work for me please.....

Thanks in advance

John

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Invoking a macro from a cell change

Come to think of it I don't think you can get controls from the control
toolbox on a chart sheet. That being said your combo box must be from the
forms toolbar. Right click the control and select Assign Macro... Associate
your macro with it and you should be ready to go...

My recomendation would be to take the guts of the change event code (give or
take a few modifications) and place it in it's own sub procedure. Your change
event will invoke that sub. Additionally your combo box will be associated
with that sub...
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Why not initiate the macro from the change event assocated with the Combo Box
instead of the linked cell? The linked cell will not fire in this case, but
the combo box will work. I would post an example for you but I don't know if
your combo box is from the Forms Toolbar or the Control Toolbox...
--
HTH...

Jim Thomlinson


"Planner999" wrote:

Hi

I am trying to run a macro that needs to run whenever the user selects
an entry from a combo box on a chart page. The combo box cell link is
returning the value and I have tried to link to that cell using the
worksheet "Private Sub Worksheet_Change(ByVal Target As Range)".
If the value changes due to the combo box value changing nothing
happens, however if I manually change the value the macro runs.

How do I make this work for me please.....

Thanks in advance

John

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Invoking a macro from a cell change

On 1 Dec, 19:18, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
Come to think of it I don't think you can get controls from the control
toolbox on a chart sheet. That being said your combo box must be from the
forms toolbar. Right click the control and select Assign Macro... Associate
your macro with it and you should be ready to go...

My recomendation would be to take the guts of the change event code (give or
take a few modifications) and place it in it's own sub procedure. Your change
event will invoke that sub. Additionally your combo box will be associated
with that sub...
--
HTH...

Jim Thomlinson



"Jim Thomlinson" wrote:
Why not initiate the macro from the change event assocated with the Combo Box
instead of the linked cell? The linked cell will not fire in this case, but
the combo box will work. I would post an example for you but I don't know if
your combo box is from the Forms Toolbar or the Control Toolbox...
--
HTH...


Jim Thomlinson


"Planner999" wrote:


Hi


I am trying to run a macro that needs to run whenever the user selects
an entry from a combo box on a chart page. The combo box cell link is
returning the value and I have tried to link to that cell using the
worksheet "Private Sub Worksheet_Change(ByVal Target As Range)".
If the value changes due to the combo box value changing nothing
happens, however if I manually change the value the macro runs.


How do I make this work for me please.....


Thanks in advance


John- Hide quoted text -


- Show quoted text -


Hi Both

I have invoked the macro from the combo box - so simple in the
end.....
Thanks for the time helping me out...


John
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
Invoking a macro from within another jnsaunders Excel Programming 3 May 30th 06 02:16 PM
Invoking macro when a tab is selected MicroMain Excel Programming 2 January 18th 06 05:51 AM
Switching woorkbooks & and invoking a macro from within a macro Bob Benjamin Excel Programming 8 January 11th 04 02:12 AM
Excel Macro Code invoking InputBox. Andrew Thorne Excel Programming 0 July 30th 03 10:23 PM


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