VBA Else statement is not working

Sun11

New Member
Joined
Nov 3, 2014
Messages
33
Hi Members,

I have this following code where, I tested it in all way, I feel the Else part of the coding is not working. Please help me to highlight where is the problem in this code. Why it does not coming in Else part.

Regards
Sun.

Code:
STEP1 = Calculation
If (condition) Then STEP2 = STEP1 - 1 Else STEP2 = STEP1
STEP3 = Calculation
STEP4 = Calculation
STEP5 = Calculation
STEP6 = Calculation
If (condition) Then
Y1 = Calculation
Y2 = Calculation
Y3 = Calculation
Y4 = Calculation
STEP7 = Y4
Else
STEP7 = Calculation


End If
Result = STEP7
 
Hi MarcelBeug & GTO,

Thank you for correcting me & putting patience with me, It was a silly mistake of "& operator". I changed it into And & it worked. :biggrin:

Regards
 
Last edited:
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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
Back
Top