command to do "nothing" in If/Then statement?

G

Guest

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,
 
C

crferguson

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

Guest

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.
 
O

Otto Moehrbach

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
 
C

count

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top