Forum Discussion
Creating a default value from drop down list
- Jan 15, 2020
You could have the validated cell point at the first cell in the list. Suppose your list populating the dropdown starts at A6, you could enter:
=$A$6....in each cell that requires validation. Example attached.
jefort You'll need a small piece of VBA in the worksheet code for that. Now, I'm not a VBA expert, so I just picked-up an example from the web https://www.automateexcel.com/vba/worksheet-change-event/ and adapted it to your schedule.
I have also added some formulae (in columns P and Q) that will work if you are on a modern Excel version that supports the use of UNIQUE and FILTER. Two functions that will be much easier to write, understand and maintain than what you currently have in column M.
Now, if you prefer not to download and open a macro enabled workbook, follow the instructions in the above-mentioned link and paste the following code in the code area for Sheet1.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$G$7" Then
Range("G8").Formula = "=M7"
End If
End Sub
- jefortMar 12, 2021Copper ContributorWhat if I have TWO If-Then statements to run for one sheet. How should I do this. For instance:
If Target.Address = "$E$10" Then
Range("W10").Formula = "=I5"
End If
If Target.Address = "'$H$4" Then
Range("AO10").Formula = "=K4"
End If- Riny_van_EekelenMar 12, 2021Platinum Contributor
jefort I guess that would work. Give it a try. As said, I'm not very much into VBA. Perhaps someone else here can step in.
- jefortMar 05, 2021Copper Contributor
WOW. Thanks a LOTTTT. It worked.
I've been searching the web on how to do this and here it is fixed already.
Thank you. Thank you.