Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DP7 DP7 is offline
external usenet poster
 
Posts: 54
Default Greater than, less than statement

I have a nested if statement, I am trying to write, if a1 greater than 500
but less than 999, then do X. I cant seem to get that part to work. Any
Ideas ???
Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Greater than, less than statement

give this a try

Sub test()
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
If ws.Range("A1") 500 And ws.Range("A1") < 999 Then
MsgBox "ok"
Else
MsgBox "not ok"
End If
End Sub


--


Gary


"DP7" wrote in message
...
I have a nested if statement, I am trying to write, if a1 greater than 500
but less than 999, then do X. I can't seem to get that part to work. Any
Ideas ???
Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Greater than, less than statement

If x 500 And x < 999 Then
MsgBox ("IN THERE")
End If
--
Gary's Student
gsnu200706


"DP7" wrote:

I have a nested if statement, I am trying to write, if a1 greater than 500
but less than 999, then do X. I cant seem to get that part to work. Any
Ideas ???
Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Greater than, less than statement

=if(and(a1500,a1<999),"X","Y")

But doing something is beyond what formulas can do.

DP7 wrote:

I have a nested if statement, I am trying to write, if a1 greater than 500
but less than 999, then do X. I cant seem to get that part to work. Any
Ideas ???
Thanks


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Greater than, less than statement

Are you trying to do these two calculations together or separate?
if A1500 and A1 <999 then do X
works for me,
but 500<A1<999 doesn't.

"DP7" wrote in message
...
I have a nested if statement, I am trying to write, if a1 greater than 500
but less than 999, then do X. I can't seem to get that part to work. Any
Ideas ???
Thanks





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Greater than, less than statement

Oopsie!

This is a programming newsgroup question.

Sorry.

Dave Peterson wrote:

=if(and(a1500,a1<999),"X","Y")

But doing something is beyond what formulas can do.

DP7 wrote:

I have a nested if statement, I am trying to write, if a1 greater than 500
but less than 999, then do X. I cant seem to get that part to work. Any
Ideas ???
Thanks


--

Dave Peterson


--

Dave Peterson
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
Greater Than 24 But Less Than 48 - If Statement Workbook Excel Worksheet Functions 4 February 4th 09 02:05 AM
Using IF statement to evaluate Greater or Less than Conditions Shams Excel Discussion (Misc queries) 2 April 3rd 08 04:49 PM
Greater Than/Less Than Question (IF statement?) Bill Excel Worksheet Functions 2 February 16th 08 03:28 PM
IF STATEMENT, GREATER THEN 0 ADD ANOTHER CELLS AMOUNT Karine Excel Worksheet Functions 2 November 19th 07 09:14 PM
Nested If statement to find greater than but less than numbers Aaron Excel Worksheet Functions 3 November 10th 06 03:14 AM


All times are GMT +1. The time now is 06:05 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"