#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default VBA SaveAs Value

I have a startup macro on one of my worksheets. It has the user input a
batch number into cell a1, and then it saves the file as the batch number.
The batch number is something like 01.ABC.255. When I try to run the macro
listed below, the file saves as a .255 file instead of a .xls file.

ActiveWorkbook.SaveAs Filename:=ActiveCell.Value

I've tried to add text and file extensions after the "value", but cant get
it to work.
Ideally I would like the user to type in 01.ABC.255 and have the file saved
as 01.ABC.255.area1.xls

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default VBA SaveAs Value

If I knew that .xls wasn't part of the value, I'd use:

ActiveWorkbook.SaveAs Filename:=ActiveCell.Value & ".xls", _
fileformat:=xlworkbooknormal



charlie wrote:

I have a startup macro on one of my worksheets. It has the user input a
batch number into cell a1, and then it saves the file as the batch number.
The batch number is something like 01.ABC.255. When I try to run the macro
listed below, the file saves as a .255 file instead of a .xls file.

ActiveWorkbook.SaveAs Filename:=ActiveCell.Value

I've tried to add text and file extensions after the "value", but cant get
it to work.
Ideally I would like the user to type in 01.ABC.255 and have the file saved
as 01.ABC.255.area1.xls

Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default VBA SaveAs Value

That does it. Thanks for your help.

"Dave Peterson" wrote:

If I knew that .xls wasn't part of the value, I'd use:

ActiveWorkbook.SaveAs Filename:=ActiveCell.Value & ".xls", _
fileformat:=xlworkbooknormal



charlie wrote:

I have a startup macro on one of my worksheets. It has the user input a
batch number into cell a1, and then it saves the file as the batch number.
The batch number is something like 01.ABC.255. When I try to run the macro
listed below, the file saves as a .255 file instead of a .xls file.

ActiveWorkbook.SaveAs Filename:=ActiveCell.Value

I've tried to add text and file extensions after the "value", but cant get
it to work.
Ideally I would like the user to type in 01.ABC.255 and have the file saved
as 01.ABC.255.area1.xls

Thanks


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default VBA SaveAs Value

Also, can I specify where it saves to?

"charlie" wrote:

I have a startup macro on one of my worksheets. It has the user input a
batch number into cell a1, and then it saves the file as the batch number.
The batch number is something like 01.ABC.255. When I try to run the macro
listed below, the file saves as a .255 file instead of a .xls file.

ActiveWorkbook.SaveAs Filename:=ActiveCell.Value

I've tried to add text and file extensions after the "value", but cant get
it to work.
Ideally I would like the user to type in 01.ABC.255 and have the file saved
as 01.ABC.255.area1.xls

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default VBA SaveAs Value

In your code?

ActiveWorkbook.SaveAs Filename:="C:\my documents\excel\" & _
ActiveCell.Value & ".xls", fileformat:=xlworkbooknormal

charlie wrote:

Also, can I specify where it saves to?

"charlie" wrote:

I have a startup macro on one of my worksheets. It has the user input a
batch number into cell a1, and then it saves the file as the batch number.
The batch number is something like 01.ABC.255. When I try to run the macro
listed below, the file saves as a .255 file instead of a .xls file.

ActiveWorkbook.SaveAs Filename:=ActiveCell.Value

I've tried to add text and file extensions after the "value", but cant get
it to work.
Ideally I would like the user to type in 01.ABC.255 and have the file saved
as 01.ABC.255.area1.xls

Thanks


--

Dave Peterson


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SaveAs Stan Halls Excel Worksheet Functions 5 November 28th 06 07:51 PM
SAveAs worksheet Brian Young Excel Worksheet Functions 14 October 25th 06 12:21 PM
saveas CSV file stevekirk Excel Discussion (Misc queries) 0 August 10th 06 01:11 PM
Saveas Macro Nigel Excel Discussion (Misc queries) 3 May 11th 05 01:15 PM
Q: overwrite during saveas JIM.H. Excel Discussion (Misc queries) 1 January 5th 05 07:27 PM


All times are GMT +1. The time now is 03:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"