Are you intending the IF statement to be in another cell of the spreadsheet, or are you talking about a statement in a macro?

In a cell, the formula =IF(A1="";"EMPTY";"FULL") would test the contents of cell A1. If A1 is null (empty), the text "EMPTY" is displayed; otherwise, the text "FULL" is displayed. You could substitute other actions here, as long as they can be expressed as a valid formula.

If you are working with a macro, try using the TYPE property in a "Select Case":

sub TEST
Dim oDoc as Object
Dim oSheet as Object
Dim oCell as Object
   oDoc = ThisComponent
   oSheet = oDoc.Sheets.getByName("Trans")
   oCell = oSheet.getCellRangeByName("F18")

   Select case oCell.Type
        Case com.sun.star.table.CellContentType.EMPTY
           ' do something for null or empty cells...
        Case com.sun.star.table.CellContentType.VALUE
           '  do something else if the cell has a VALUE
   End Select
end sub

(Note that if the cell has a type of TEXT, nothing is done. Or if the cell has a FORMULA, nothing is done).

-- John Viestenz (new user, trying to learn this stuff, too)

----- Original Message ----- From: "Gert Blij" <[EMAIL PROTECTED]>
To: "OpenOffice" <[email protected]>
Sent: Thursday, June 30, 2005 7:04 AM
Subject: [users] IF statement with "Blank Cell" condition


How can I create an IF statement that says:

If a cell is blank (null (?)) do something else do something else.

TIA
Gert


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to