running macros based on meeting cell conditions

Andre_1

New member
Joined
Jul 11, 2014
Messages
1
Reaction score
0
Points
0
I am running EXCEL 2010 and am trying to run an else_if macro that will run one of two different macros based on the condition (value) of another cell, M6

I am trying to run 2 different reports, and need a different macro to run each report, depending on the user's selection of which report he wants (in cell M6).

Currently my VB macro looks like this:

Sub else_if()
If Range("M6") = "Display_Variance_Report" Then
Call testloop 'macro3
ElseIf Range("M6") = "Display_Monthly_Report" Then
Call testloop 'macro2
End If
End Sub

When I try to run this macro is says that it "Can't execute code in break mode". What have I done wrong, and how can I easily fix this up?

I am quite new to macros and VB programming so please don't get too technical, I can follow basic instructions pretty well though.

I am designing a work project at the moment and am in need of immediate help, thank you anybody for your assistance, much appreciated!
 

Bob Phillips

Super Moderator
Staff member
Joined
Mar 21, 2011
Messages
1,942
Reaction score
0
Points
36
Excel Version(s)
O365
Impossible to tell, that code does not look that it would deliver that error. Post your workbook and details on how we can replicate.
 
Top