ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to work multiple ifs (https://www.excelbanter.com/excel-programming/432932-how-work-multiple-ifs.html)

homer

How to work multiple ifs
 
Sub Special_Terms()
If AH13 = AH6 Then
Call Special_Terms_Lunda
If AH13 = AH7 Then
Call Special_Terms_Ames
Else
Call Delete_Special_Terms
End If
End If
End Sub



Rick Rothstein

How to work multiple ifs
 
It looks like you are after this structure (note the ElseIf statement)...

Sub Special_Terms()
If AH13 = AH6 Then
Call Special_Terms_Lunda
ElseIf AH13 = AH7 Then
Call Special_Terms_Ames
Else
Call Delete_Special_Terms
End If
End Sub

--
Rick (MVP - Excel)


"Homer" wrote in message
...
Sub Special_Terms()
If AH13 = AH6 Then
Call Special_Terms_Lunda
If AH13 = AH7 Then
Call Special_Terms_Ames
Else
Call Delete_Special_Terms
End If
End If
End Sub





All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com