If..Then..Else functionality

bsnapool

Active Member
Joined
Jul 10, 2006
Messages
452
Hi All

I am trying to get my head round the basics of VBA, and would like a full or detailed description of this functionality and how it would be used...

I have done some internet searches and found some websites but would like a detailed perspective with maybe an example??

Any help?

Thanks in advance

Andrew
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Any simple description would be ok. It is just so I can get to grips with the basics....

Any help would be much appreciated...

Thanks
 
Upvote 0
Perhaps a simple example might help:

Code:
If ISType = 2 Then
           I = InIS / 62500
ElseIf ISType = 3 Then
           I = InIS / 40000
ElseIf ISType = 1 Then
           I = InIS
Else
           GoTo QinErr
End If

There can be many lines of code between each If ... Else, not just one per case as here.
 
Upvote 0
You should also be able to find explanations and examples in any beginning VBA book.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top