Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default changing validation drop down based on another cell value

I need to change the drop-down list in a validation based on what is entered
in another cell. The other cell will be a vendor name and the list should be
product codes for that vendor.

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default changing validation drop down based on another cell value

have a look at this site.
http://www.contextures.com/xlDataVal02.html
--
jb


"pawlingJohn" wrote:

I need to change the drop-down list in a validation based on what is entered
in another cell. The other cell will be a vendor name and the list should be
product codes for that vendor.

thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default changing validation drop down based on another cell value

If you want to change the LIST in data validation in cell a3 based on what
changes in cell a2, use this with NAMED ranges for your lists. Right click
sheet tabinsert this.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$2" Then
With Range("a3").Validation
'delete those not needed
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="=" & Range("a2") '"list1"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
I need to change the drop-down list in a validation based on what is
entered
in another cell. The other cell will be a vendor name and the list should
be
product codes for that vendor.

thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default changing validation drop down based on another cell value

thanks yet again guys i got what i needed

"Don Guillett" wrote:

If you want to change the LIST in data validation in cell a3 based on what
changes in cell a2, use this with NAMED ranges for your lists. Right click
sheet tabinsert this.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$2" Then
With Range("a3").Validation
'delete those not needed
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="=" & Range("a2") '"list1"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
I need to change the drop-down list in a validation based on what is
entered
in another cell. The other cell will be a vendor name and the list should
be
product codes for that vendor.

thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how blank data validation cell after changing dependent cell? Ian Elliott Excel Discussion (Misc queries) 5 August 16th 09 02:42 AM
Data validation list drop-down values based on prior selections David Excel Programming 2 September 26th 08 03:58 PM
Source Range Data changing based on drop-down menu [email protected] Charts and Charting in Excel 3 March 9th 08 06:19 PM
Changing Multiple Cell Colours based on Drop Down option Selected Grumpy Head Excel Programming 2 September 15th 06 01:26 AM
Dynamically adding an in-cell drop-down list (i.e. Validation Object) to a cell? debartsa Excel Programming 5 March 5th 04 08:45 AM


All times are GMT +1. The time now is 03:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"