New blanks cells populated when selecting from drop down lists

Jonam711

New Member
Joined
Jun 11, 2022
Messages
24
Office Version
  1. 365
Platform
  1. Windows
In A1 I've got drop down list of employees. From C1 I have months as header in 1st row until N1. When i select a employee from the drop down list in A1 the cells from C2 to N2 has to remain blank to enter the data for every month for that employee. When I chose next employee from drop down the cells has to be blank again to enter the data for that respective employee. Such that for every employee in the drop down. Is it possible?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
The only way you can do this is with VBA. There is no other way to automatically clear data that the user has entered.

Put this code into the worksheet module for the worksheet containing this data, and save as a .xlsm file.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

   Application.EnableEvents = False

   If Target.Address = "$A$1" Then
      [C2:N2].ClearContents
   End If

   Application.EnableEvents = True

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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