Run A Macro

gmazza76

Well-known Member
Joined
Mar 19, 2011
Messages
771
Office Version
  1. 365
Platform
  1. Windows
Good Afternoon,

I am trying to automatically populate some cells depending on a drop down.

The drop down is in cell "B2" on Sheet1.

I am using the code below to enter the names etc... but am unsure of how to assign it to change when Cell "B2" does
I know the code looks promative but it is the only way i can think of doing it as the file is shared and i cannot use AutoFilter due to this

Code:
If "B2" = "Atiff Mazhar" Then
 
    B4 = "Carolyne Anderson"
    B5 = "Charlotte Ryalls"
    
End If

Many Thanks
Gavin
 
=IF(COUNTA($E$4:E4)<FONT COLOR="RED"><COUNTIF</FONT>(B:B,$E$3),INDEX($C:$C,MATCH($E$3,$B:$B,0)+COUNTA($E$4:E4)),"")
 
Last edited:
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,224,606
Messages
6,179,865
Members
452,948
Latest member
UsmanAli786

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