Workbook add, reqest name

  • Thread starter Thread starter ianripping
  • Start date Start date
I

ianripping

I want a macro to add a workbook using: -

Workbooks.Add
But then uses a cell (eg A1) to create its name with a descrtiptio
afterwards.

Eg a1 = January
Description is " - Monthly Stats"

Any body got the answer
 
As I understand it, a workbook does not get a name until it is saved.
 
ok is it possible to save the workbook with a name entered into a cell?

also can you use a cell refernce to rename a sheet name
 
Filename in A1
Sheetname in A2

Sub test()
Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\" & Range("A1").Value & ".xls"
Application.DisplayAlerts = True

Worksheets(1).Name = Range("A2").Value
End Sub


DisplayAlerts prevents the warning "a file already exists with this name"
 

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

Back
Top