Data may exist in the sheet(s) message

C

cedtech23

How do I stop excel from give this message by answer for my users?

"Data may exist in the sheet(s) selection for deletion. To permanentl
delete the date, Press Delete"


my code is

Code
-------------------

Sub CopyCells()

Range("A1:I15").Select
Selection.Copy
Sheets.Add
ActiveSheet.Paste
Sheets(1).Select
Sheets(1).Name = "LeaveRequest"
Cells.Select
Application.CutCopyMode = False
With Selection.Interior
.ColorIndex = 2
.PatternColorIndex = xlAutomatic
End With
ActiveWindow.DisplayHeadings = False
Sheets("LeaveRequested").Select
ActiveWindow.SelectedSheets.Delete
Range("l9").Select
End Sub
 
D

Duncan

Try this...

Sub CopyCells()
Application.displayalerts = false
Range("A1:I15").Select
Selection.Copy
Sheets.Add
ActiveSheet.Paste
Sheets(1).Select
Sheets(1).Name = "LeaveRequest"
Cells.Select
Application.CutCopyMode = False
With Selection.Interior
.ColorIndex = 2
.PatternColorIndex = xlAutomatic
End With
ActiveWindow.DisplayHeadings = False
Sheets("LeaveRequested").Select
ActiveWindow.SelectedSheets.Delete
Range("l9").Select
Application.displayalerts = true
End Sub

Duncan
 

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