Skip Override Prompt in Macro

I

iperlovsky

I have a histogram macro that I am trying to run, but I receive a prompt that
says something like "output range will overwrite existing data. Press OK to
overwrite data in range..." The window displays the "OK" button, "Cancel",
and "Help". How do I have the macro shut this off or power through this
automatically? PS: The macro runs 20 histograms sequentially.
 
G

Gord Dibben

Maybe

application.displayalerts = false

code to run

application.displayalerts = true


Gord Dibben MS Excel MVP
 
E

EricG

For a more general solution, there is always "Tools/Options.../Edit", "Alert
before overwriting cells" (uncheck the box).

Eric
 
I

iperlovsky

I tried this but it did not work. Maybe it has to do with the alert type:
overwrite existing cells. Any ideas? Here is some of the code:

Sub Histo()
Application.DisplayAlerts = False
Application.Run "ATPVBAEN.XLA!Histogram", ActiveSheet.Range("_01"),
ActiveSheet.Range("$FV$34"), _ , False, False, False, False
Application.Run "ATPVBAEN.XLA!Histogram", ActiveSheet.Range("_02"),
ActiveSheet.Range("$FX$34"), _ , False, False, False, False
Application.DisplayAlerts = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top