Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have code that I have tried in various ways yet I can not get the code to
recognize a blank cell. For z1 = 7 To 1300 If Cells(z1, 9) = "" Then Cells(z1, 10) = "HI" If IsNull(Cells(z1, 9)) = True Then Cells(z1, 10) = "HI" Next z1 I only used the word hi to stick out on the sheet. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Are you sure the cells are empty. A cell may be "false empty" if it contains
a space character. Try this: For z1 = 7 To 1300 If Trim(Cells(z1, 9)) = "" Then Cells(z1, 10) = "HI" If IsNull(Cells(z1, 9)) = True Then Cells(z1, 10) = "HI" Next z1 Regards, Per "Rpettis31" skrev i meddelelsen ... I have code that I have tried in various ways yet I can not get the code to recognize a blank cell. For z1 = 7 To 1300 If Cells(z1, 9) = "" Then Cells(z1, 10) = "HI" If IsNull(Cells(z1, 9)) = True Then Cells(z1, 10) = "HI" Next z1 I only used the word hi to stick out on the sheet. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Nov 13, 3:31*pm, Rpettis31
wrote: I have code that I have tried in various ways yet I can not get the code to recognize a blank cell. * For z1 = 7 To 1300 * * * * If Cells(z1, 9) = "" Then Cells(z1, 10) = "HI" * * * * If IsNull(Cells(z1, 9)) = True Then Cells(z1, 10) = "HI" * * Next z1 I only used the word hi to stick out on the sheet. Instead of using If Cells(z1, 9) = "", use If IsEmpty(Cells(Z1,9)). This will truly check for an empty cell. Doing it the other way can result in cells looking like they are blank but are filled with spaces. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Failed to save table attributes of (null) into (null). | Excel Discussion (Misc queries) | |||
EXCEL Spreadsheet CELLS have data but load as NULL | Excel Programming | |||
Generating blank or null cells that the Histogram Data Analysis tool will ignore | Excel Worksheet Functions | |||
NULL Cells | Excel Worksheet Functions | |||
Cells().value is null but I can see data | Excel Programming |