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

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,216,163
Messages
6,129,223
Members
449,495
Latest member
janzablox

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