Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default command to do "nothing" in If/Then statement?

I want to cancel out the then part of an if/then but not change anything else.
I want it to do "nothing" instead of what it is doing.
I tried commenting out the then part and I got a run time error so I just
want it to exit the then portion and keep running.

if xxxxxx
then "do nothing"

thanks,




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default command to do "nothing" in If/Then statement?

Can you please post a little bit of the code you're having trouble
with? Sounds like a logical error...


Janis wrote:
I want to cancel out the then part of an if/then but not change anything else.
I want it to do "nothing" instead of what it is doing.
I tried commenting out the then part and I got a run time error so I just
want it to exit the then portion and keep running.

if xxxxxx
then "do nothing"

thanks,


  #3   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default command to do "nothing" in If/Then statement?

You will have to comment out every line between "If..Then" and "End If".
Alternatively, if its a huge block of code, cut the entire "If..Then" to
"End If" structure out and paste somewhere to save it (like Notepad, for
instance). You can always copy and paste it back in later.
--
Les Torchia-Wells


"Janis" wrote:

I want to cancel out the then part of an if/then but not change anything else.
I want it to do "nothing" instead of what it is doing.
I tried commenting out the then part and I got a run time error so I just
want it to exit the then portion and keep running.

if xxxxxx
then "do nothing"

thanks,




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default command to do "nothing" in If/Then statement?

Are you saying that you want the execution of the code to continue if the
argument is True? What do you want to happen if the argument is False? HTH
Otto
"Janis" wrote in message
...
I want to cancel out the then part of an if/then but not change anything
else.
I want it to do "nothing" instead of what it is doing.
I tried commenting out the then part and I got a run time error so I just
want it to exit the then portion and keep running.

if xxxxxx
then "do nothing"

thanks,






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default command to do "nothing" in If/Then statement?

The problem as I can see is in the syntax: 'Then "keyword should be on If
line
If xxxxx then
yyyy
zzzz
else
YyYyY
ZzZzZ
End If
I think cancelling that you want, involves just putting apostrophies like
this ' in fron of yyyy and zzz above.
Or in a brand new code you can do:
If a 0 then
else
YyYyY
ZzZzZ
End If
PS.
Some code uses syntax that places command right after Then, like this:
If a 0 then P=4
no End If, no Else
In such case just modify syntax to have end if and you're done.
HTH
Paul
Użytkownik "Janis" napisał w wiadomo¶ci
...
I want to cancel out the then part of an if/then but not change anything
else.
I want it to do "nothing" instead of what it is doing.
I tried commenting out the then part and I got a run time error so I just
want it to exit the then portion and keep running.

if xxxxxx
then "do nothing"

thanks,






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to have a macro simply issue the "find" command or "control f: Charles Adams Excel Programming 3 February 6th 09 06:34 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
embedding "ISERROR" function into an "IF" statement [email protected] Excel Worksheet Functions 8 January 4th 07 12:01 AM
inserting a conditional "go to" command on a excel "if" function velasques Excel Worksheet Functions 5 March 10th 06 08:16 PM
Is there a "replace" or "Substitute" command in Excel's VB? [email protected] Excel Programming 2 December 5th 03 07:56 AM


All times are GMT +1. The time now is 11:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"