Helllllllllpppp Problem with macros and lists.

Diane_E_Thomas

New Member
Joined
Apr 18, 2002
Messages
17
Please can someone help me.

I have created a list of 14 things using data validation/ lists, but now I want to asign a macro to each of the 14 options, so that when I select an option from my drop down list a macro will automatically run, and if I chose another option, another macro would run. Perhaps I need a different way of creating my list? Any advice would be greatly appreciated.
 
Ah, what's happening is that you're changing a cell, calling macro2, which then changes a cell and calls itself recursively. Try changing the event subroutine to this:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

If Target.Address <> "$O$9" Then Exit Sub
If Target.Value = "Triangular" Then
Run ("macro2")
End If

End Sub

This will only run when the cell being changed is O9 and it's changed to 'Triangular'. HTH.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Sorry, Diane, this works OK for me on a test sheet. Again, this will only run if the cell being changed is O9 and the value it is changed to is 'Triangular' (case-sensitive). It won't run if 'Triangular' is already in the cell, you would need to put in another value, then put 'Triangular' back in.
 
Upvote 0

Forum statistics

Threads
1,215,078
Messages
6,122,997
Members
449,093
Latest member
masterms

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top