Hi,
I have a simple macro to copy a sheet and to paste that to new sheet added to after sheet1. Whenever I use data range A1 to F51, an error "There isn't enough memory to complete this action" occurs. But if I replace range with entire sheet it works. Can anyone tell me why vba can copy entire sheet but can not copy range A1 to F51. In this sheet there are only formulae are sums. No bigger of complicated formulae.
Following works:
Sub CopySheet()
Sheet1.Cells.Copy
Sheets.Add after:=Worksheets(Sheets.Count)
ActiveSheet.Name = Sheet1.Cells(2, "A")
ActiveSheet.Cells.PasteSpecial xlPasteFormats
ActiveSheet.Cells.PasteSpecial xlPasteValues
End Sub
Following does not working
Sub CopySheet()
Sheet1.Range("A1:F51").Copy
Sheets.Add after:=Worksheets(Sheets.Count)
ActiveSheet.Name = Sheet1.Cells(2, "A")
ActiveSheet.Cells.PasteSpecial xlPasteFormats
ActiveSheet.Cells.PasteSpecial xlPasteValues
End Sub
Bookmarks