#1   Report Post  
Posted to microsoft.public.excel.misc
flow23
 
Posts: n/a
Default save as

Is it possible to have a macro that will save as a new file with value from
a particular field

say the current file is Report.xls
say the value in sheet1 and range B3 is "14/03/2006"

The file should save as " Report 14/03/2006 .xls"


  #2   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default save as

with Workbooks("Report.xls")
.SaveAs format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") &
".xls"
end with

I modified the date format because / are not authorized in file names.

HTH
--
AP

"flow23" a écrit dans le message de
...
Is it possible to have a macro that will save as a new file with value

from
a particular field

say the current file is Report.xls
say the value in sheet1 and range B3 is "14/03/2006"

The file should save as " Report 14/03/2006 .xls"




  #3   Report Post  
Posted to microsoft.public.excel.misc
flow23
 
Posts: n/a
Default save as

thanks it works great

can I also add the location of the file name to a particualr folder on the
network?

"Ardus Petus" wrote:

with Workbooks("Report.xls")
.SaveAs format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") &
".xls"
end with

I modified the date format because / are not authorized in file names.

HTH
--
AP

"flow23" a écrit dans le message de
...
Is it possible to have a macro that will save as a new file with value

from
a particular field

say the current file is Report.xls
say the value in sheet1 and range B3 is "14/03/2006"

The file should save as " Report 14/03/2006 .xls"





  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default save as

One way:

with Workbooks("Report.xls")
.SaveAs "\\yoursharename\yourfoldername1\yourfoldernam e2\" & "Report " & _
format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") & ".xls"
end with

flow23 wrote:

thanks it works great

can I also add the location of the file name to a particualr folder on the
network?

"Ardus Petus" wrote:

with Workbooks("Report.xls")
.SaveAs format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") &
".xls"
end with

I modified the date format because / are not authorized in file names.

HTH
--
AP

"flow23" a écrit dans le message de
...
Is it possible to have a macro that will save as a new file with value

from
a particular field

say the current file is Report.xls
say the value in sheet1 and range B3 is "14/03/2006"

The file should save as " Report 14/03/2006 .xls"






--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
flow23
 
Posts: n/a
Default save as

Many thanks



"Dave Peterson" wrote:

One way:

with Workbooks("Report.xls")
.SaveAs "\\yoursharename\yourfoldername1\yourfoldernam e2\" & "Report " & _
format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") & ".xls"
end with

flow23 wrote:

thanks it works great

can I also add the location of the file name to a particualr folder on the
network?

"Ardus Petus" wrote:

with Workbooks("Report.xls")
.SaveAs format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") &
".xls"
end with

I modified the date format because / are not authorized in file names.

HTH
--
AP

"flow23" a écrit dans le message de
...
Is it possible to have a macro that will save as a new file with value
from
a particular field

say the current file is Report.xls
say the value in sheet1 and range B3 is "14/03/2006"

The file should save as " Report 14/03/2006 .xls"






--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
Jim May
 
Posts: n/a
Default save as

The original Filename portion "Report" is not being picked up
in the new filename; Only the date.
TIA,


"Ardus Petus" wrote:

with Workbooks("Report.xls")
.SaveAs format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") &
".xls"
end with

I modified the date format because / are not authorized in file names.

HTH
--
AP

"flow23" a écrit dans le message de
...
Is it possible to have a macro that will save as a new file with value

from
a particular field

say the current file is Report.xls
say the value in sheet1 and range B3 is "14/03/2006"

The file should save as " Report 14/03/2006 .xls"





  #7   Report Post  
Posted to microsoft.public.excel.misc
Jim May
 
Posts: n/a
Default save as

OK,
After modifying line to: (.name being added)

.SaveAs .name format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") &
".xls"


It works as expected.
Tks,


"Jim May" wrote:

The original Filename portion "Report" is not being picked up
in the new filename; Only the date.
TIA,


"Ardus Petus" wrote:

with Workbooks("Report.xls")
.SaveAs format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") &
".xls"
end with

I modified the date format because / are not authorized in file names.

HTH
--
AP

"flow23" a écrit dans le message de
...
Is it possible to have a macro that will save as a new file with value

from
a particular field

say the current file is Report.xls
say the value in sheet1 and range B3 is "14/03/2006"

The file should save as " Report 14/03/2006 .xls"





  #8   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default save as

I bet you'd want to strip the .xls out of the .name property, too.

Jim May wrote:

OK,
After modifying line to: (.name being added)

.SaveAs .name format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") &
".xls"


It works as expected.
Tks,

"Jim May" wrote:

The original Filename portion "Report" is not being picked up
in the new filename; Only the date.
TIA,


"Ardus Petus" wrote:

with Workbooks("Report.xls")
.SaveAs format(.Worksheets("Sheet1").Range("B3").value, "dd-mm-yyyy") &
".xls"
end with

I modified the date format because / are not authorized in file names.

HTH
--
AP

"flow23" a écrit dans le message de
...
Is it possible to have a macro that will save as a new file with value
from
a particular field

say the current file is Report.xls
say the value in sheet1 and range B3 is "14/03/2006"

The file should save as " Report 14/03/2006 .xls"






--

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
macro save a workbook whilst increasing file no shrek Excel Worksheet Functions 0 November 10th 05 02:40 PM
save as isnt there neither is the save button pressable fernandzefruitcake Excel Discussion (Misc queries) 3 September 28th 05 04:15 PM
Save as Msg box monster Excel Discussion (Misc queries) 3 August 31st 05 06:45 PM
Save as Msg box Bob Umlas, Excel MVP Excel Discussion (Misc queries) 0 August 29th 05 09:56 PM
Save & Save As features in file menu of Excel Blue Excel Discussion (Misc queries) 9 December 27th 04 08:49 PM


All times are GMT +1. The time now is 09:03 AM.

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"