Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Msgbox not displaying

Hi, I am running this macro as a filter, "Filter_Report_15", in a series of
macros but the messge box will not display. The purpose of the display is to
alert the user to update the database with the correct value.

The code is below:
Cells.Select

If Worksheets("Report 15").Range("Z2") = "Y" And Worksheets("Report
15").Range("M2") = "N" Then Reponse = MsgBox("The Subject to Arrow Assessment
checkbox has not been ticked. Please amend the Assessment in IRM", vbOKOnly)
If Response = 0 Then Call Finish

The "call Finish" takes the program to the last macro in the series
correctly and executes ok but the "Exit Sub" command only takes us back to
the next line in the "Filter_Report_15" macro. I wish this macro to end the
series.

I have tried the code below but it does not stop the series.


Windows("Report Creation.xls").Activate
Sheets("Report Creation").Select
With ActiveWorkbook
.RunAutoMacros xlAutoClose
'.Close
End With

End Sub

Any help greatly appreciated.

Davie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Msgbox not displaying

Just had a Homer Simpson moment. I am referencing the wrong row, row 2 and
not the filtered row. I will look at changing this.
I still need to know how to end the series macro.

Davie
"davethewelder" wrote:

Hi, I am running this macro as a filter, "Filter_Report_15", in a series of
macros but the messge box will not display. The purpose of the display is to
alert the user to update the database with the correct value.

The code is below:
Cells.Select

If Worksheets("Report 15").Range("Z2") = "Y" And Worksheets("Report
15").Range("M2") = "N" Then Reponse = MsgBox("The Subject to Arrow Assessment
checkbox has not been ticked. Please amend the Assessment in IRM", vbOKOnly)
If Response = 0 Then Call Finish

The "call Finish" takes the program to the last macro in the series
correctly and executes ok but the "Exit Sub" command only takes us back to
the next line in the "Filter_Report_15" macro. I wish this macro to end the
series.

I have tried the code below but it does not stop the series.


Windows("Report Creation.xls").Activate
Sheets("Report Creation").Select
With ActiveWorkbook
.RunAutoMacros xlAutoClose
'.Close
End With

End Sub

Any help greatly appreciated.

Davie

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Msgbox not displaying


If Response = 0 Then
Call Finish
Exit Sub
End If
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"davethewelder"
wrote in message
Just had a Homer Simpson moment. I am referencing the wrong row, row 2 and
not the filtered row. I will look at changing this.
I still need to know how to end the series macro.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Msgbox not displaying

Jim, thanks for that, it does stop the macro.

Cheers,

Davie

"Jim Cone" wrote:


If Response = 0 Then
Call Finish
Exit Sub
End If
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"davethewelder"
wrote in message
Just had a Homer Simpson moment. I am referencing the wrong row, row 2 and
not the filtered row. I will look at changing this.
I still need to know how to end the series macro.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Msgbox not displaying

Jim, when I run it in the full series it goes to the Finish macro, which is
the last in the series, and then goes to the next macro down from
Report_15_Filter. This continues to run the rest of the series with
gobledegook produced.

Davie

"davethewelder" wrote:

Jim, thanks for that, it does stop the macro.

Cheers,

Davie

"Jim Cone" wrote:


If Response = 0 Then
Call Finish
Exit Sub
End If
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"davethewelder"
wrote in message
Just had a Homer Simpson moment. I am referencing the wrong row, row 2 and
not the filtered row. I will look at changing this.
I still need to know how to end the series macro.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Msgbox not displaying

If your Report_15_Filter sub is called by another sub then
code will continue to run until that other sub runs out of calls.
For instance in the sequence below, when each macro is done the next
sub in the call sequence is run.

Sub OriginalMacro
Call Macro2
Call Report_15_Filter
Call Macro3
CallMacro4
End Sub

The order in which Subs are placed in a module has no effect
on when (or if) a sub is run.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"davethewelder"
wrote in message
Jim, when I run it in the full series it goes to the Finish macro, which is
the last in the series, and then goes to the next macro down from
Report_15_Filter. This continues to run the rest of the series with
gobledegook produced.
Davie



"davethewelder" wrote:
Jim, thanks for that, it does stop the macro.
Cheers,
Davie




"Jim Cone" wrote:
If Response = 0 Then
Call Finish
Exit Sub
End If
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





"davethewelder"
wrote in message
Just had a Homer Simpson moment. I am referencing the wrong row, row 2 and
not the filtered row. I will look at changing this.
I still need to know how to end the series macro.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Msgbox not displaying

Jim, I have copied all the code into one module and it works fine. Thanks
for your help.

Davie

"Jim Cone" wrote:

If your Report_15_Filter sub is called by another sub then
code will continue to run until that other sub runs out of calls.
For instance in the sequence below, when each macro is done the next
sub in the call sequence is run.

Sub OriginalMacro
Call Macro2
Call Report_15_Filter
Call Macro3
CallMacro4
End Sub

The order in which Subs are placed in a module has no effect
on when (or if) a sub is run.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"davethewelder"
wrote in message
Jim, when I run it in the full series it goes to the Finish macro, which is
the last in the series, and then goes to the next macro down from
Report_15_Filter. This continues to run the rest of the series with
gobledegook produced.
Davie



"davethewelder" wrote:
Jim, thanks for that, it does stop the macro.
Cheers,
Davie




"Jim Cone" wrote:
If Response = 0 Then
Call Finish
Exit Sub
End If
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)





"davethewelder"
wrote in message
Just had a Homer Simpson moment. I am referencing the wrong row, row 2 and
not the filtered row. I will look at changing this.
I still need to know how to end the series macro.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
msgbox James Coughlan Excel Discussion (Misc queries) 3 May 3rd 06 01:57 PM
MsgBox Help Zach H Excel Programming 3 February 24th 06 03:16 PM
Displaying A MsgBox for X Seconds Mark Excel Programming 1 July 15th 05 02:41 PM
MsgBox not displaying right away Ray Kanner[_2_] Excel Programming 1 April 7th 05 02:30 AM
Msgbox help JonoB Excel Programming 2 October 27th 03 03:06 PM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"