macro conditions

G

Guest

Here's a stupid question,

I'm creating a macro group. I would like each command within the macro
group to execute only if a specific condition is met-otherwise proceed to
the next action. I know the process has to do with ellipses (...), but can't
quite remember how to proceed.

Can someone provide a quick answer?

thanks
 
G

Guest

Hi,
try to move away from macros and adapt VBA (visual basic for applications)
code. Macros are very limited and cannot handle error handling.
In VBA you can then use an if then else statement to evaluate certain things
and do an action based on that or use a case statement if you have a lot of
validation and it could get messier.
HTH
Good luck
 
K

Ken Snell \(MVP\)

There is a Condition column in the macro design view, and you can put an
expression in that column for a macro action -- when the expression
evaluates to True, the action is performed; if it's False, the action is
skipped.

The ellipsis (. . .) is used in the Condition box for the action(s)
subsequent to a Condition expression to show that the action(s) are to be
run if the Condition expresssion was true. This is the macro's syntax for an
If Then type of context, where more than one action is to be run if the
Condition is True.
 
G

Guest

Thank you for the response. If I understand correctly, if the condition is
false (in my scenario meaning that action should not execute), then the next
action I want to execute should be preceded with the ellipsis?
 
G

Guest

Thank you for the response. I'm not very familiar with VBA and have tried to
avoid where possible. Could you recommend a good resource for self-teaching?
 
S

Steve Schapel

Oliver,
try to move away from macros and adapt VBA (visual basic for applications)
code. Macros are very limited and cannot handle error handling.

Can I point out that this is a .macros newsgroup, so people are looking
for help with macros here. Thanks.
 
S

Steve Schapel

TBurnett,

The ellipsis in the Condition would mean that if the Condition in the
previous action evaluates to False, the subsequent action will not
execute either.

If you need further help with this, maybe you could give us an example
of what you are working with - it is often easier to talk specifics.
 
G

Guest

Thank you very much, I think that statement set me straight. This is my
first time using the discussion groups and it's turned out to be a great
resource.

Have a good one!
 

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