Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Macro to run on change


Hi all,

Sure there is a really simple answer to this one - but if I can crack
this it will really help.

I have two drop down lists where the user can select from three
different options.

What I would like to happen is that when anyone selects a different
option from the drop down list then the Macro Sort5ColumnGrid is
automtically run.

IS this possible?

Thanks for any help

Regards

Carl


--
mr_teacher
------------------------------------------------------------------------
mr_teacher's Profile: http://www.excelforum.com/member.php...o&userid=34352
View this thread: http://www.excelforum.com/showthread...hreadid=568797

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 459
Default Macro to run on change

mr_teacher wrote:
Hi all,

Sure there is a really simple answer to this one - but if I can crack
this it will really help.

I have two drop down lists where the user can select from three
different options.

What I would like to happen is that when anyone selects a different
option from the drop down list then the Macro Sort5ColumnGrid is
automtically run.

IS this possible?

Thanks for any help

Regards

Carl


Hi Carl,

you need to use the Worksheet_Change event.

Right click on the tab of the sheet with the drop down list and select Show
Code. Copy & past this code:

Private Sub Worksheet_Change(ByVal Target As Range)
Call Your_macro
End Sub


where you have to change Your_macro with the real name of your macro. In
this way every time that something change on your worksheet, the macro will
run.

If, instead, you want to run the macro only if a specific range change, use
this code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
Call Your_macro
Else
Exit Sub
End If
End Sub

where you have to change A1 with your real range and Your_macro with the
real name of your macro.


--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


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
Macro To Change Cell Color When Value Changes carl Excel Worksheet Functions 4 March 14th 06 08:24 PM
Using this Automatic Resizing Macro with Worksheet Change [email protected] Excel Discussion (Misc queries) 0 December 19th 05 03:57 PM
Event Macro adjustment needed - need to change font color also nick s Excel Worksheet Functions 2 November 28th 05 05:50 PM
Where to stick macro to change default comment font? [email protected] Excel Discussion (Misc queries) 1 January 1st 05 12:57 AM
Macro button colour change??? Beefyme Excel Worksheet Functions 1 November 19th 04 06:15 PM


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