View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Simple question?? Nested ifs on one line

Wouldn't it be easier just to write it as
If OneH = YNewH Then Goto DisplayMsg

If YNewH is anything, then it's not going to be blank, so for OneH to =
YNewH, then OneH can't be "", by definition. Of course, if there's a
possibility that YNewH could be = "", then the way you have it now is the
better way to go (and one that would work properly if YNewH can sometimes be
"").

"laavista" wrote:

IT WORKED!! THANK YOU so much for taking the time to answer my question.

If was trying to add the "end if" at the end of the statement to no avail.

Thanks again. I really appreciate it!

"JBeaucaire" wrote:

How about:
========
If OneH < "" And OneH = YNewH The Goto DisplayMsg
========

--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"laavista" wrote:

I'm using Excel 2003.

This seems like it should be very simple, but I've tried lots of things, and
nothing works.

I have a large amount of "checks" to do so I would like to put 2 if
statements on one line.

I'd like to put this on one line:

If OneH < "" then
If OneH = YNewH then
goto DisplayMsg
end if
end if

Your help would be GREATLY appreciated!