ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User-defined function to give blank cell? (https://www.excelbanter.com/excel-programming/413691-user-defined-function-give-blank-cell.html)

wal

User-defined function to give blank cell?
 
Excel 2003

I have a spreadsheet function that looks something like this:

=IF(OR(RangeA=0,RangeA=""),"",IF(RangeA-15000<=0,"",RangeA-15000))

I need to add more conditions, so I'm trying to write a user-defined
VBA function. What code (if any) can be included in such a function
to get the first result shown above, i.e., a blank cell (symbolized by
"" in a worksheet function) under certain conditions?

Thanks.

Tim Zych

User-defined function to give blank cell?
 
Same as a worksheet function, a zero-length string ("") although some
developers use vbNullString. They are slightly different internally but for
your purposes they should be functionally similar.

Rob Bovey explains the difference:
http://www.dailydoseofexcel.com/arch...-cells-in-vba/

And a little more info:
XL2000: How to Use Visual Basic Constants in Text Strings
http://support.microsoft.com/kb/211774/en-us


--
Tim Zych
www.higherdata.com
Compare data in Excel and find differences with Workbook Compare
A free, powerful, flexible Excel utility


"wal" wrote in message
...
Excel 2003

I have a spreadsheet function that looks something like this:

=IF(OR(RangeA=0,RangeA=""),"",IF(RangeA-15000<=0,"",RangeA-15000))

I need to add more conditions, so I'm trying to write a user-defined
VBA function. What code (if any) can be included in such a function
to get the first result shown above, i.e., a blank cell (symbolized by
"" in a worksheet function) under certain conditions?

Thanks.









All times are GMT +1. The time now is 04:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com