View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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