supress message

G

geebee

hi,

i would like to know how i can supress te following message:

"do you want to replace the contents of the destination cells in Sheet1?"

i have DisplayAlerts = False in my code, but its not helping. i am not
sure what to do.

thanks in advance,
geebee
 
G

geebee

basically it is when a pivot table includes or reflects more rows than it
currently reflects. no majic code here.
 
C

cubbybear3

I am having the same/similar problem. I have a 'temporary' sheet that
I delete and re-load but do not want to see the caution/warning
message verifying the deletion. Here is the code I am using.

Sub RawData_Reset()

' delete & re-create the worksheet "RawData"
Sheets("RawData").Select
ActiveWindow.SelectedSheets.Delete

Sheets("DataBase").Select
ActiveWorkbook.Worksheets.Add.Name = "RawData"

End Sub
 
C

cubbybear3

Never mind. I found an older posting about "DisplayAlerts". My
problems was that I did not have "Application." in front of it.
 
D

Don Guillett

You may like this better but why are you doing this?

Sub RawData_Reset()
' delete & re-create the worksheet "RawData"
application.displayalerts=false
Sheets("RawData").Delete
application.displayalerts=true
Sheets("DataBase").Select 'WHY ???
ActiveWorkbook.Worksheets.Add.Name = "RawData"
End Sub
 
C

cubbybear3

I did add the "application.displayalerts=false/true" statements.
just did not have them in the code when I did the cut/paste.

As for why the "Sheets("DataBase").Select", to make sure the
new worksheet is always in the same place (after the DATABASE
sheet).
 
D

Don Guillett

ActiveWorkbook.Worksheets.Add after:=Sheets("DataBase")
ActiveSheet.Name = "RawData"
 
C

cubbybear3

Thanks Don. I like finding new ways to 'tighten up' my code. That is
why I frequent this newsgroup.
-pb
 

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