Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, I need to test a cell to see if it contains anything. If not
will delete its row. Sometimes the cell is "empty" and sometimes it i "null". Testing for both seems like too much. I will reuse this cod over and over. My question is, is there a way I can make each cell not containin info "null" or "empty" so I just have to test for one of them. M thought is to make a sub that will go through the sheet and make eac non-used cell "null". When I go to test later I can then just test fo each cell being null. Or if there is some simpler way to test for bot instead of isNull(cell1) or isEmpty(cell1). I could make my own su that does it, but I don't want to reinvent the wheel if one is ou there. Thanks -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Plea
"gwgeller " wrote in message ... Hello, I need to test a cell to see if it contains anything. If not I will delete its row. Sometimes the cell is "empty" and sometimes it is "null". Testing for both seems like too much. I will reuse this code over and over. My question is, is there a way I can make each cell not containing info "null" or "empty" so I just have to test for one of them. My thought is to make a sub that will go through the sheet and make each non-used cell "null". When I go to test later I can then just test for each cell being null. Or if there is some simpler way to test for both instead of isNull(cell1) or isEmpty(cell1). I could make my own sub that does it, but I don't want to reinvent the wheel if one is out there. Thanks. --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Please share with me how you would make the cell contain NULL and return
true for an IsNull Test (since you say you could change all blanks to NULL). for each cell in selection if Trim(cell.Text) = "" then cell.EntireRow.Delete End if Next -- Regards, Tom Ogilvy "gwgeller " wrote in message ... Hello, I need to test a cell to see if it contains anything. If not I will delete its row. Sometimes the cell is "empty" and sometimes it is "null". Testing for both seems like too much. I will reuse this code over and over. My question is, is there a way I can make each cell not containing info "null" or "empty" so I just have to test for one of them. My thought is to make a sub that will go through the sheet and make each non-used cell "null". When I go to test later I can then just test for each cell being null. Or if there is some simpler way to test for both instead of isNull(cell1) or isEmpty(cell1). I could make my own sub that does it, but I don't want to reinvent the wheel if one is out there. Thanks. --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That is what I was thinking of doing, I was hoping someone would know
-- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have only seen a few uses for isnull in Excel VBA and I can't recall a
situation where you can get a true response from IsNull from a cell (there could be a way, but unlikely you will encounter it. I don't think bringing in Null fields from an external database puts a Null in the field, but I can't say I have tested it.) Anyway, I showed you a way that should work. -- Regards, Tom Ogilvy "gwgeller " wrote in message ... That is what I was thinking of doing, I was hoping someone would know. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Failed to save table attributes of (null) into (null). | Excel Discussion (Misc queries) | |||
setting a cell to 'empty' or blank or null ? | New Users to Excel | |||
How do you stop excel from charting empty cells/null values as zer | Charts and Charting in Excel | |||
make cell contents equal to null value - not blank, but empty | Excel Worksheet Functions | |||
testing for non-empty cells | Excel Programming |