Save sheet copy with cell value name using a macro.

L

Leo Rod

Good afternoon All,

I need a VB statement to save a copy of the sheet i'm using (same were the
macro is executed) with a cell value (EG cell "B2") of the workbook I'm
using into a predefined path (EG "C:\").

If anybody can help me with this I'll be very glad.

Leo.
 
G

Gord Dibben

You want to save a sheet as a workbook with a name of the value in Range("B2")
of the sheet?

Sub Make_New_Book()
Dim w As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
ActiveSheet.Copy
ActiveWorkbook.SaveAs Filename:="C:\MyFolder\" & Range("B2").Value
ActiveWorkbook.Close
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP
 

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