Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Stopping the "This removes the subtotal and sorts again." notifica

I am running a macro across multiple tabs where I am removing subtotals.
Prior to the removal of the subtotals for each tab the "This removes the
subtotal and sorts again" notification pops-up and the "OK" button must be
clicked to proceed. How can I turn off this notification?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Stopping the "This removes the subtotal and sorts again." notifica

application.DisplayAlerts=False

"Hoppy" a écrit dans le message de news:
...
I am running a macro across multiple tabs where I am removing subtotals.
Prior to the removal of the subtotals for each tab the "This removes the
subtotal and sorts again" notification pops-up and the "OK" button must be
clicked to proceed. How can I turn off this notification?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Stopping the "This removes the subtotal and sorts again." notifica

Untested but you could try this...

Application.displayalerts = false
'Your code here
Application.displayalerts = true
--
HTH...

Jim Thomlinson


"Hoppy" wrote:

I am running a macro across multiple tabs where I am removing subtotals.
Prior to the removal of the subtotals for each tab the "This removes the
subtotal and sorts again" notification pops-up and the "OK" button must be
clicked to proceed. How can I turn off this notification?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Stopping the "This removes the subtotal and sorts again." noti

This is an application level setting so you must be sure to reset it to True
when you are done. In fact it should really have an error handler on it to
ensure that it gets reset. Something like this (I neglected to add the error
handler in my post).

public sub Whatever()
on error goto ErrorHandler
application.displayalerts = false
'your code here
ErrorHandler:
application.displayalerts = true
end sub

--
HTH...

Jim Thomlinson


"Tiah" wrote:

application.DisplayAlerts=False

"Hoppy" a écrit dans le message de news:
...
I am running a macro across multiple tabs where I am removing subtotals.
Prior to the removal of the subtotals for each tab the "This removes the
subtotal and sorts again" notification pops-up and the "OK" button must be
clicked to proceed. How can I turn off this notification?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Stopping the "This removes the subtotal and sorts again." noti

Thanks for the help!

"Jim Thomlinson" wrote:

This is an application level setting so you must be sure to reset it to True
when you are done. In fact it should really have an error handler on it to
ensure that it gets reset. Something like this (I neglected to add the error
handler in my post).

public sub Whatever()
on error goto ErrorHandler
application.displayalerts = false
'your code here
ErrorHandler:
application.displayalerts = true
end sub

--
HTH...

Jim Thomlinson


"Tiah" wrote:

application.DisplayAlerts=False

"Hoppy" a écrit dans le message de news:
...
I am running a macro across multiple tabs where I am removing subtotals.
Prior to the removal of the subtotals for each tab the "This removes the
subtotal and sorts again" notification pops-up and the "OK" button must be
clicked to proceed. How can I turn off this notification?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Stopping the "This removes the subtotal and sorts again." notifica

Precede with

Application.DisplayAlerts = False

and reset to True after.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hoppy" wrote in message
...
I am running a macro across multiple tabs where I am removing subtotals.
Prior to the removal of the subtotals for each tab the "This removes the
subtotal and sorts again" notification pops-up and the "OK" button must be
clicked to proceed. How can I turn off this notification?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Stopping the "This removes the subtotal and sorts again." notifica

try
application.DisplayAlerts = False

'code that causes a message

application.DisplayAlerts = True

--
regards,
Tom Ogilvy

"Hoppy" wrote:

I am running a macro across multiple tabs where I am removing subtotals.
Prior to the removal of the subtotals for each tab the "This removes the
subtotal and sorts again" notification pops-up and the "OK" button must be
clicked to proceed. How can I turn off this notification?

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Stopping the "This removes the subtotal and sorts again." noti

From the help on displayalerts:

"If you set this property to False, Micorosoft Excel sets this property to
True when the code is finished, unless you are running cross process code."

so while there is nothing wrong with what you suggest, what you imply is
usually not the case.

--
Regards,
Tom Ogilvy






"Jim Thomlinson" wrote:

This is an application level setting so you must be sure to reset it to True
when you are done. In fact it should really have an error handler on it to
ensure that it gets reset. Something like this (I neglected to add the error
handler in my post).

public sub Whatever()
on error goto ErrorHandler
application.displayalerts = false
'your code here
ErrorHandler:
application.displayalerts = true
end sub

--
HTH...

Jim Thomlinson


"Tiah" wrote:

application.DisplayAlerts=False

"Hoppy" a écrit dans le message de news:
...
I am running a macro across multiple tabs where I am removing subtotals.
Prior to the removal of the subtotals for each tab the "This removes the
subtotal and sorts again" notification pops-up and the "OK" button must be
clicked to proceed. How can I turn off this notification?




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Stopping the "This removes the subtotal and sorts again." noti

Absolutely true and thanks for clearing that up. That and being a little bit
lazy is why I left the error handler out in my original code. Display alerts
is one of those automatic resetting switches. Unlike some other switches that
do not reset themselves, such as EnableEvents. IMO you are best off to always
use an error handler. As you point out it is not always necesary, but it
never hurts. An error handler only takes a few seconds to add and if you are
wrong about what gets automatically reset, or Excel decides to change the way
it handles these things (like that would ever happen <bg)then you are
covered. Just my two cents...
--
HTH...

Jim Thomlinson


"Tom Ogilvy" wrote:

From the help on displayalerts:

"If you set this property to False, Micorosoft Excel sets this property to
True when the code is finished, unless you are running cross process code."

so while there is nothing wrong with what you suggest, what you imply is
usually not the case.

--
Regards,
Tom Ogilvy






"Jim Thomlinson" wrote:

This is an application level setting so you must be sure to reset it to True
when you are done. In fact it should really have an error handler on it to
ensure that it gets reset. Something like this (I neglected to add the error
handler in my post).

public sub Whatever()
on error goto ErrorHandler
application.displayalerts = false
'your code here
ErrorHandler:
application.displayalerts = true
end sub

--
HTH...

Jim Thomlinson


"Tiah" wrote:

application.DisplayAlerts=False

"Hoppy" a écrit dans le message de news:
...
I am running a macro across multiple tabs where I am removing subtotals.
Prior to the removal of the subtotals for each tab the "This removes the
subtotal and sorts again" notification pops-up and the "OK" button must be
clicked to proceed. How can I turn off this notification?



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
Stopping looped "Find" command Varne Excel Discussion (Misc queries) 3 September 24th 07 09:26 AM
Stopping "Query Refresh" messages fmistry Excel Discussion (Misc queries) 0 February 27th 07 08:33 PM
Stopping the "This removes the subtotal and sorts again." notifica Hoppy Excel Discussion (Misc queries) 1 August 3rd 06 08:55 PM
Stopping the "Next" command when a blank cell is reached. Bhupinder Rayat Excel Programming 2 November 17th 05 05:42 PM
Stopping "Link Worksheets?" message box (using automation) pw Excel Programming 1 July 24th 03 03:54 AM


All times are GMT +1. The time now is 01:53 AM.

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"