Hi I am new to the message board. I am able to record my macro but I am wondering how to activate the macro when I choose an item from a name list that I have created.
Are you referring to the Name Box up on the top left hand corner of the screen (to the left of the formula bar) or are you talking about a list using Data Validation?
If it is the former, you could run the event off the sheets SelectionChange event, insuring that Target is the same as your named range.
If the later, you could use the Change event and validate by both Target and Target's value.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$4" Then' Address C4 as givenIf Target.Value = "Run Macro1" Then Macro1 ' List Option and Macro name made up.End If
End Sub
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.