if/then again

S

steven

i know the standard if then goes - if this then that. i
was wondering if you can go - if this then that and that?
thx
 
A

Anders Silven

Do you mean

'*****
If this Then
that1
that2
End If
'*****

?

Regards
Anders Silven
 
K

Kevin H. Stecyk

Steven,

Perhaps you could put more flesh on the example.

If this, then that and that?

B1=if(A1=5, 6, 8)

There B1 can only have one value. You can choose what values you have in
the formula, but it makes no sense to say, if A1=5, then B1 equals 6 and 9.

However, with VBA, you could say,

If A1=5, then set
B1=4
C1=5
D1=6
E1=7

and if A1 <>5, then
B1=0
C1=0
D1=0
E1=0

So it all depends on the context. If it is a formula, then a single cell
can only hold one value.

If you want more cells set, then you need more formulas, one for each cell.

If you are using VBA, then you have much greater freedom.

I am not sure if I answered your question, but I hope I have given you some
food for thought.

Best regards,
Kevin




steven wrote...
 

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