ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook add, reqest name (https://www.excelbanter.com/excel-programming/294043-workbook-add-reqest-name.html)

ianripping[_39_]

Workbook add, reqest name
 
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

--
Message posted from http://www.ExcelForum.com


Rob van Gelder[_4_]

Workbook add, reqest name
 
As I understand it, a workbook does not get a name until it is saved.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"ianripping " wrote in message
...
I want a macro to add a workbook using: -

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

Eg a1 = January
Description is " - Monthly Stats"

Any body got the answer?


---
Message posted from http://www.ExcelForum.com/




ianripping[_40_]

Workbook add, reqest name
 
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

--
Message posted from http://www.ExcelForum.com


Rob van Gelder[_4_]

Workbook add, reqest 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"


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"ianripping " wrote in message
...
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?


---
Message posted from http://www.ExcelForum.com/




ianripping[_41_]

Workbook add, reqest name
 
Thankyou

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 02:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com