#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default values

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default values

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
-------------------------------
now, if you enter a value 10 or <3 you get an messagebox
and the focus stays on A1 so that you have to change the value...

Best regards



"dajaal" schrieb im Newsbeitrag
...
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.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default values

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.

--
Regards,
Tom Ogilvy




"dajaal" wrote:

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.


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
Excel 2007 doesnt show Y-axis values when the values are small. outback Charts and Charting in Excel 2 October 26th 08 01:37 AM
Exclude #N/A values and Return Numeric values to consecutive cells in Single Row Sam via OfficeKB.com Excel Worksheet Functions 5 February 9th 08 03:07 AM
Search/Filter to find values in another range based on two cell values Andy Excel Programming 2 April 29th 04 04:08 PM
How do I search thr'o column and put unique values in differnt sheet and sum corresponding values in test test Excel Programming 3 September 9th 03 08:53 PM
Predict Y-values on new X-values based on other actual X and Y values? NorTor Excel Programming 2 August 10th 03 03:08 PM


All times are GMT +1. The time now is 09:29 AM.

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

About Us

"It's about Microsoft Excel"