Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro save a workbook whilst increasing file no | Excel Worksheet Functions | |||
save as isnt there neither is the save button pressable | Excel Discussion (Misc queries) | |||
Save as Msg box | Excel Discussion (Misc queries) | |||
Save as Msg box | Excel Discussion (Misc queries) | |||
Save & Save As features in file menu of Excel | Excel Discussion (Misc queries) |