sì, effettivamente funziona, ma... che differenza cè tra la tua funzione ed il cancellarmi dopo il Foglio1???Originariamente inviato da andreaciao_22
ciao Luisa,
Prova questo codice da vba di excel
...
Non ce neanche il caso di rinominare il foglio in !!!!!! infatti se levo il codice è uguale! Il delete o prima o dopo lo devo usare.
codice:Sub ProvaCopia() Dim NewBook As Workbook, ActWkb As Workbook, CopySheet As Worksheet, shNewBook As Worksheet Dim intShNew As Integer, scUpdate As Boolean, dpAlert As Boolean With Application scUpdate = .ScreenUpdating dpAlert = .DisplayAlerts intShNew = .SheetsInNewWorkbook .ScreenUpdating = False .SheetsInNewWorkbook = 1 .DisplayAlerts = False Set ActWkb = .ActiveWorkbook 'o il workbook da cui devi copiare Set CopySheet = ActWkb.Sheets(1) Set NewBook = .Workbooks.Add Set shNewBook = NewBook.Sheets(1) 'shNewBook.Name = "!!!|||!!!" CopySheet.Copy shNewBook shNewBook.Delete NewBook.Activate Set shNewBook = Nothing Set NewBook = Nothing Set CopySheet = Nothing Set ActWkb = Nothing .SheetsInNewWorkbook = intShNew .ScreenUpdating = scUpdate .DisplayAlerts = dpAlert End With End Sub

Rispondi quotando