Macro to run another macro if the header of the selected column = "Name"

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

I need a macro that can run another macro if the change is made in that column?

So I have a sheet and in Row 11 I have headers,
so if I type in any cell above row 11 do nothing,
if i type something select a drop down or paste something in a row lower than row 11 then if the column i made that change in has a header in row 11 that = "Name"
then call New Name, if not do nothing.

please help if you can

Thanks

Tony
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Right click on sheet name, view code
paste below code into edit window:
VBA Code:
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim subname
If Target.Row <= 11 Then Exit Sub
subname = Cells(11, Target.Column).Value
Application.Run subname
End Sub

ALso, insert new module, paste below code (or using your own code):

VBA Code:
Sub Name1()
MsgBox "Hello name1"

End Sub
Sub Name2()
MsgBox "Hello name2"

End Sub
Capture.JPG
 

Attachments

  • Capture.JPG
    Capture.JPG
    31.5 KB · Views: 2
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

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