ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using If and Validation to turn a cell on one way or another (https://www.excelbanter.com/excel-programming/336837-re-using-if-validation-turn-cell-one-way-another.html)

Vasant Nanavati

Using If and Validation to turn a cell on one way or another
 
You would have to set up a Worksheet_Change macro so that when the adjacent
cell is changed, validation is set up. Hard to explain further without
details.

Example:

If Range("B1") = 0 Then
Range("A1").Validation.Delete
Else
Range("A1").Validation.Add Type:=xlValidateList, Formula1:="1,2,3"
End If

--

Vasant








"ghawk" wrote in message
...
I have a Cell that I would like to setup to us an IF statement or a
variable.
I am trying to set this cell up that IF True it will work from a List Box,
but if False it will allow me to type in General Text or numbers. I can
set
it up for one or the other currently, but need it to do both depending on
what is in the cell next to it.




ghawk

Using If and Validation to turn a cell on one way or another
 
I have created a simple example file of what I am trying to accomplish see
the attached file, or please email me at and I
will send the file.

"Vasant Nanavati" wrote:

You would have to set up a Worksheet_Change macro so that when the adjacent
cell is changed, validation is set up. Hard to explain further without
details.

Example:

If Range("B1") = 0 Then
Range("A1").Validation.Delete
Else
Range("A1").Validation.Add Type:=xlValidateList, Formula1:="1,2,3"
End If

--

Vasant








"ghawk" wrote in message
...
I have a Cell that I would like to setup to us an IF statement or a
variable.
I am trying to set this cell up that IF True it will work from a List Box,
but if False it will allow me to type in General Text or numbers. I can
set
it up for one or the other currently, but need it to do both depending on
what is in the cell next to it.






All times are GMT +1. The time now is 02:09 PM.

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