![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 91
|
i am testing a cell which contains either a number between 0 and 9 and if it contains zero to return true and return false if it contains 1:9 or if it is blank. The problem is it returns true not only when it contains zero but even if the cell is blank.
any help much apreciated |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Ahmedabad Gujarat
Posts: 303
|
Sub selecttruefalse()
If IsEmpty(ActiveCell) Then ActiveCell = False Exit Sub End If Select Case ActiveCell Case 1 To 9 ActiveCell = False Case Is = 0 ActiveCell = True End Select End Sub nishith desai http://www.pexcel.com |
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
[ This Message was edited by: Mark W. on 2002-04-16 08:27 ] |
|
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
produces either 1 or 0 instead of TRUE or FALSE repectively (1=TRUE,0=FALSE). If you rather want to see a logical value as result, use: =AND((LEN(A1)=1)*(A1=0)) Aladin |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|