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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

bsnapool

Active Member
Joined
Jul 10, 2006
Messages
452
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
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,951
Office Version
  1. 365
Platform
  1. Windows
You should also be able to find explanations and examples in any beginning VBA book.
 

Forum statistics

Threads
1,141,095
Messages
5,704,311
Members
421,338
Latest member
Pepess

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
Top