values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I want to set a cell as follows

if cell a1 >=3 then cell b1 must return x
but i want to restrict cell a1 to be less than 10 as well. in other words
cella1 must be greater or equal to 3 but less than 10.

PLEAAASE Help.
 
Hi,

please insert the followin code intoo you Worksheet
------------------------------
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Range("A1").Value < 3 Or Range("A1").Value > 10 Then
MsgBox "only between 0 an 10"
Range("A1").Select
End If
End Sub
 
Look at Data=>Validation.

If you select Whole Number or Decimal, you are offered a Between Option
where you can set the min and max values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top