K
KJ
Here is a macro I created. Run I run the macro it creates the new file with
the correct filename in the correct location. However I still have the
previous (Book1) file open.
What I want is to close Book1 without saving.
Any help would be greatly appreciated.
Thanks, Ken.
Sub copyws()
Dim strName As String
Dim ws As Worksheet
strName = "C:\Documents and Settings\Ken1\My Documents\Quotes\" &
Range("A1").Value
Set ws = ThisWorkbook.Sheets(1)
Application.Workbooks.Add
ws.Copy before:=ActiveWorkbook.Sheets(1)
ActiveWorkbook.SaveAs strName
Set ws = Nothing
End Sub
the correct filename in the correct location. However I still have the
previous (Book1) file open.
What I want is to close Book1 without saving.
Any help would be greatly appreciated.
Thanks, Ken.
Sub copyws()
Dim strName As String
Dim ws As Worksheet
strName = "C:\Documents and Settings\Ken1\My Documents\Quotes\" &
Range("A1").Value
Set ws = ThisWorkbook.Sheets(1)
Application.Workbooks.Add
ws.Copy before:=ActiveWorkbook.Sheets(1)
ActiveWorkbook.SaveAs strName
Set ws = Nothing
End Sub