Default Value in Data Validation List

Armengar

New Member
Joined
Sep 23, 2011
Messages
3
I'm building a checklist (for webpages) and have the following problem.
I want my Data Validation List to use a default value if another cell has a certain value.

I've added an example of how I basicly want it to look like:
http://www.armengar.nl/example.xlsm

In the orange fields are Dropdown boxes, which get filled IF column D = YES (formula is in Data Validation screen).

The thing I want to add is that IF column D = YES the the Cell in column E jumps to a default value of the list (specified in the List tab). It doesn't really matter if its from the list or if i have to specify the default value in the macro.

I've searched around a bit and found 2 macro's that do something similar, but my VB knowledge is very small, so tuning them for my situation hasn't been succesfull.

Im working with excel 2010
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
I had someone help me out and now i have the following VBA code:

PHP:
Option Explicit 
Private Sub Worksheet_Change(ByVal Target As Range) 
  If Target.Column = 4 Then 'Check when Column D is changes 
    If UCase(Target.Value) = "YES" Then 
        Cells(Target.Row, 5).Value = "DefaultYesWaarde" 'Value that gets used if D = YES 
    ElseIf UCase(Target.Value) = "NO" Then 
        Cells(Target.Row, 5).Value = "DefaultNoWaarde"  'Value that gets used if D = NO
    End If 
 End If 
End Sub

Now this works, but only if i actually adjust the value in column D, not if I adjust the value in column B (which then adjust the value in D). Can anyone tell me what i should add/adjust to make it work like that?
 
Upvote 0
Can noone give me an indication? I've been trying to combine this with several scripts I found on these boards but i keep getting errors :(
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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