Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need to save workorders using customer data. I'd like to run a macro that
does this automatically using data from range A2:D2 or E2 (which is a data merge of the previous named cells,A2,B2,C2,D2. I've been on this task for 3 days and I am just not getting it. Any help would be helpfull. Thanks Bill T. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
in a macro sub save_it() dim fname with activeworkbook fname = .worksheets("sheet1").range("E2").value & ".xls" ..saveas fname end with end sub "fail2excel" wrote: I need to save workorders using customer data. I'd like to run a macro that does this automatically using data from range A2:D2 or E2 (which is a data merge of the previous named cells,A2,B2,C2,D2. I've been on this task for 3 days and I am just not getting it. Any help would be helpfull. Thanks Bill T. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You don't mention anything about the path where you want to save the file.
Here is some code to save the new file in the same spot as the existing file... sub test with thisworkbook .saveas thisworkbook.path & "\" & Sheets("MySheet").Range("E2").value end with end sub Where it says Sheets("MySheet"). Change MySheet to the appropriate tab name. -- HTH... Jim Thomlinson "fail2excel" wrote: I need to save workorders using customer data. I'd like to run a macro that does this automatically using data from range A2:D2 or E2 (which is a data merge of the previous named cells,A2,B2,C2,D2. I've been on this task for 3 days and I am just not getting it. Any help would be helpfull. Thanks Bill T. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Jul 20, 9:52*am, fail2excel
wrote: I need to save workorders using customer data. *I'd like to run a macro that does this automatically using data from range A2:D2 or E2 (which is a data merge of the previous named cells,A2,B2,C2,D2. I've been on this task for 3 days and I am just not getting it. *Any help would be helpfull. Thanks Bill T. Sub workorder() 'Saves filename as value of (CELL INFORMATION) plus the current date Dim newFile As String, fName As String ' Don't use "/" in date, invalid syntax fName = Range("E2").Value 'Change the date format to whatever you'd like, but make sure it's in quotes newFile = fName & " " & Format$(Date, "mm-dd-yyyy") ' Change the directory and file path to yours and saves file as shipment number, date, and time ActiveWorkbook.SaveAs Filename:="C:\JohnSims\MyFiles\WorkOrders\ " & Range("E2").Value & " - " & Format(Now, "yyyy-mm-dd_hhmmss") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I use a worsheet name (filename), and a range name as values? | Excel Discussion (Misc queries) | |||
Cell("filename") doesn't update to new filename when do save as. | Excel Worksheet Functions | |||
Using Range().Formula with a Filename & Path | Excel Discussion (Misc queries) | |||
How do I generate a list from a range of values | Excel Worksheet Functions | |||
Using TODAY() to generate a filename from where values are VLOOKUPed | Links and Linking in Excel |