ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Check for blank arguments WITHIN Macro - how? (https://www.excelbanter.com/excel-programming/354906-check-blank-arguments-within-macro-how.html)

JuergenL

Check for blank arguments WITHIN Macro - how?
 

I need to check WITHIN a macro if an argument is blank. A cell, used a
argument, which has no value entered is in my case undefined, Exce
makes it zero, and I cannot find any way to test it.
I know I can do it BEFORE I pass an argument to the macro [e.g.
IF(A1="","whatever",A1)], but I like to do it inside the macro.

Is there a way? How?

Thanks in advance for any help / ideas.

Juerge

--
Juergen
-----------------------------------------------------------------------
JuergenL's Profile: http://www.excelforum.com/member.php...fo&userid=2181
View this thread: http://www.excelforum.com/showthread.php?threadid=51835


Tom Ogilvy

Check for blank arguments WITHIN Macro - how?
 
if isempty(cell) then

or
if len(trim(cell)) = 0 then

if it must be a number

if not isnumeric(cell) then

--
Regards,
Tom Ogilvy


"JuergenL" wrote in
message ...

I need to check WITHIN a macro if an argument is blank. A cell, used as
argument, which has no value entered is in my case undefined, Excel
makes it zero, and I cannot find any way to test it.
I know I can do it BEFORE I pass an argument to the macro [e.g.:
IF(A1="","whatever",A1)], but I like to do it inside the macro.

Is there a way? How?

Thanks in advance for any help / ideas.

Juergen


--
JuergenL
------------------------------------------------------------------------
JuergenL's Profile:

http://www.excelforum.com/member.php...o&userid=21816
View this thread: http://www.excelforum.com/showthread...hreadid=518350




JuergenL[_2_]

Check for blank arguments WITHIN Macro - how?
 

Thanks for the quick answer, I tried 'em all and but none work WITHIN
the macro. By that time the blank cell is already converted to zero, it
seems.

Juergen


--
JuergenL
------------------------------------------------------------------------
JuergenL's Profile: http://www.excelforum.com/member.php...o&userid=21816
View this thread: http://www.excelforum.com/showthread...hreadid=518350


Tom Ogilvy

Check for blank arguments WITHIN Macro - how?
 
What can I say. Perhaps someone who is psychic can help.

--
Regards,
Tom Ogilvy


"JuergenL" wrote in
message ...

Thanks for the quick answer, I tried 'em all and but none work WITHIN
the macro. By that time the blank cell is already converted to zero, it
seems.

Juergen


--
JuergenL
------------------------------------------------------------------------
JuergenL's Profile:

http://www.excelforum.com/member.php...o&userid=21816
View this thread: http://www.excelforum.com/showthread...hreadid=518350





All times are GMT +1. The time now is 05:35 PM.

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