ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Data Validation (https://www.excelbanter.com/excel-programming/274000-data-validation.html)

Soniya

Data Validation
 
Hi All,

How can I set a data validation to a cell to accept
either multiples of 10 or 15 ?
any help..

TIA

Soniya

Harald Staff[_4_]

Data Validation
 
Hi Soniya

Don't think you can without code -hope I'm wrong.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
If Target.Value = "" Then Exit Sub
If Val(Target.Value) Mod 10 = 0 Then
ElseIf Val(Target.Value) Mod 15 = 0 Then
Else
Target.Value = ""
End If
End If
End Sub

--
HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.

"Soniya" wrote in message
...
Hi All,

How can I set a data validation to a cell to accept
either multiples of 10 or 15 ?
any help..

TIA

Soniya




Rob Bovey

Data Validation
 
"Soniya" wrote in message
...
Hi All,

How can I set a data validation to a cell to accept
either multiples of 10 or 15 ?


Hi Soniya,

Choose Data/Validation and select the Custom option from the Allow
dropdown. Then enter the following formula:

=OR(MOD(A1,10)=0,MOD(A1,15)=0)

Be sure to change A1 to the address of the cell you're applying this
validation to.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *



William[_2_]

Data Validation
 
In the first cell where you wish to apply data validation (D32 in this
example), in the validation criteria box select "Custom". In the "Formula"
box enter the following and then copy the cell to the range where you want
the same type of validation.
=OR(MOD(D32,10)=0,MOD(D32,15)=0)

--
XL2002
Regards

William


"Soniya" wrote in message
...
| Hi All,
|
| How can I set a data validation to a cell to accept
| either multiples of 10 or 15 ?
| any help..
|
| TIA
|
| Soniya






Harald Staff[_4_]

Data Validation
 
"Rob Bovey" wrote in message
...

Choose Data/Validation and select the Custom option from the Allow
dropdown. Then enter the following formula:

=OR(MOD(A1,10)=0,MOD(A1,15)=0)


Cool. Thanks Rob. You live and you learn. (You in this case is me :-)
Now why is this suddenly "custom" and not "formula is" like in conditional formatting ?
Strange.

Best wishes Harald
Excel MVP

Followup to newsgroup only please.




Rob Bovey

Data Validation
 
"Harald Staff" wrote in message
...
Now why is this suddenly "custom" and not "formula is" like in conditional

formatting ?

Hi Harald,

Custom refers to the type of data validation you want to apply. It's one
of the selections in the Allow dropdown, which includes Whole number, List,
Date, etc. Once you've selected Custom from the Allow dropdown, the control
where you enter the formula is labeled "Formula", which is not too much
different from conditional formatting.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *




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

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