View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Code to add a workbook the rename it

This is from the VBA help file:

The Name property returns the workbook name. You cannot set the name by
using this property; if you need to change the name, use the SaveAs method to
save the workbook under a different name.

"L. Howard Kittle" wrote:

Hi Excel users and experts

Excel 2002

From help I get the following to name a workbook. It errors out with a
yellow line. I tried the macro recorder but it give the file name and a
whole string of stuff I don't want using Save As.

Am I missing a menu item that will allow me to record a workbook name
change??? (The AutoFit is just part of the code to format a sheet)

Columns("A:K").Columns.AutoFit
Workbook.Names.Add Name:="The Newest"

Thanks,
Howard