ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   changing validation drop down based on another cell value (https://www.excelbanter.com/excel-programming/422553-changing-validation-drop-down-based-another-cell-value.html)

pawlingJohn

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

John

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


Don Guillett

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



pawlingJohn

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




Don Guillett

changing validation drop down based on another cell value
 

Which was?
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
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





pawlingJohn

changing validation drop down based on another cell value
 
a P.O. form that changes product dropdown menus depending on who your
ordering from.

This Discussion Group is great

"Don Guillett" wrote:


Which was?
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"pawlingJohn" wrote in message
...
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






All times are GMT +1. The time now is 07:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com