If Then Else Statement

P

Pradip Jain

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
 
T

Toppers

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


HTH
 
T

Tom Ogilvy

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
 

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