Macro to Exit Sub if Cell E2 is zero on sheet "Sales Summary Analysis"

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I have the following code below

I would like to exit the Macro if after running Macro Open_SalesAnalysis , the value in E2 = 0 on sheet "Sales Summary Analysis"

It would be appreciated if someone could kindly assist me

Code:
 Sub Update_Data()
ChDir ("C:\extract")
Dim response
response = MsgBox("Have you Filtered and removed Clearing JNLS from sales Analysis Sheet under reference", vbYesNo)
If response = vbNo Then
Exit Sub
Else
End If
 
Unfilter_AllSheets
Formula_Turnover
Open_SalesAnalysis
Application.Calculation = xlCalculationAutomatic
 With Sheets("Sales Summary Analysis")
If .Range("E2") = 0 Then
MsgBox "Please delete Clearing JNLS"
Exit Sub
 Else
     
   End If
 End With
Application.Calculation = xlCalculationManual


Insert_Columns
Create_Formula
Application.Calculation = xlCalculationAutomatic
 end Sub
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
That's what your code is doing.
 
Upvote 0
Hi Fluff

I don't know what i did, but does exit the sub if E2 is zero (i'm having a blue Monday)
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,869
Members
449,054
Latest member
juliecooper255

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