Hi All
I have been reading up on copying sheets to a newly created workbook and have modified (joined together) info i have found on line.
I'm getting a runtime error 1004 here
Cells(1, 1).Select
ws.Activate
Below is the whole of the code I have come up with for this, but one thing I have noticed is that the pasted sheet still has the formulae in it not the values??
Any ideas where I'm going wrong please
cheers
Paul
I have been reading up on copying sheets to a newly created workbook and have modified (joined together) info i have found on line.
I'm getting a runtime error 1004 here
Cells(1, 1).Select
ws.Activate
Below is the whole of the code I have come up with for this, but one thing I have noticed is that the pasted sheet still has the formulae in it not the values??
Any ideas where I'm going wrong please
cheers
Paul
VBA Code:
Option Explicit
Sub Move_New_Workbook()
Dim NewName As String
Dim nm As Name
Dim ws As Worksheet
Dim MyDate
MyDate = Date
With Application
.ScreenUpdating = False
On Error GoTo ErrCatcher
Sheets(Array("MiREG Month By Month", "Tony Morley")).Copy
On Error GoTo 0
For Each ws In ActiveWorkbook.Worksheets
ws.Cells.Copy
ws.[A1].PasteSpecial Paste:=xlValues
ws.Cells.Hyperlinks.Delete
Application.CutCopyMode = False
Cells(1, 1).Select
ws.Activate
Next ws
Cells(1, 1).Select
' Remove named ranges
For Each nm In ActiveWorkbook.Names
nm.Delete
Next nm
NewName = "New MiREG Report:-" & MyDate
ActiveWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & NewName & ".xls"
ActiveWorkbook.Close SaveChanges:=False
.ScreenUpdating = True
End With
Exit Sub
ErrCatcher:
MsgBox "Specified sheets do not exist within this workbook"
End Sub