ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If Then Else Statement (https://www.excelbanter.com/excel-programming/327964-if-then-else-statement.html)

Pradip Jain

If Then Else Statement
 
Hi
I am using the following code:

If Distribution = 2 Then Param1 = Mean And Param2 = StDev Else Param1 =
UpperBound And Param2 = LowerBound

Variables Param1 and Param2 are not picking up any values. When i keep just
one variable then it is working. Thus the following code works:

If Distribution = 2 Then Param1 = Mean Else Param1 = UpperBound

Please help

Thanks, Pradip


Toppers

If Then Else Statement
 


If Distribution = 2 Then
Param1=Mean
Param2=StDev
Else
Param1=Upperbound
Param2=LowerBoound
End If


HTH
"Pradip Jain" wrote:

Hi
I am using the following code:

If Distribution = 2 Then Param1 = Mean And Param2 = StDev Else Param1 =
UpperBound And Param2 = LowerBound

Variables Param1 and Param2 are not picking up any values. When i keep just
one variable then it is working. Thus the following code works:

If Distribution = 2 Then Param1 = Mean Else Param1 = UpperBound

Please help

Thanks, Pradip


Tom Ogilvy

If Then Else Statement
 
You are trying to execute two statements in one command - that is invalid
syntax for what you want to do, but is valid syntax for something completely
different (which is why you don't get an error). You need

If Distribution = 2 Then
Param1 = Mean
Param2 = StDev
Else
Param1 = UpperBound
Param2 = LowerBound
End if


--
Regards,
Tom Ogilvy


"Pradip Jain" wrote in message
...
Hi
I am using the following code:

If Distribution = 2 Then Param1 = Mean And Param2 = StDev Else Param1 =
UpperBound And Param2 = LowerBound

Variables Param1 and Param2 are not picking up any values. When i keep

just
one variable then it is working. Thus the following code works:

If Distribution = 2 Then Param1 = Mean Else Param1 = UpperBound

Please help

Thanks, Pradip





All times are GMT +1. The time now is 04:12 PM.

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