Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am hoping with your programming skills, by way of a coded macro, to save an
exel file by operating a button and achieving the following objective automatically... name file as... customer_date_time.xls and save file to specific path for example c:\archive\product A --- please note customer name is variable - which is selected from a drop down list in a specific cell in an order form. date & time is real time The time variable is required and preferable as it is possible for 1 customer to take 2 different products on the same date. One cannot have to two file names the same!. For example : customer A_301006.xls (X2) wont work but customer A_301006_1000.xls and customer A_301006_1005 will save without conflict ---- Background information... I have 3 order forms set out vertically on a single spreadsheet covering 1 specific product. There is more than 1 product! (Product A-Z). All 3 order forms on the Product A spreadsheet are for the same product. All 3 order forms can be used for different customers selected from a drop down list in a specific cell located within the actual order form. The individual orders are only saved to a specific archive product location folder manually at the moment! (example c:\archive\product A) once customer has recieved the product. As all 3 order forms are on 1 spreadsheet I dont want to save all 3 simultaneoulsly, otherwise I will unnecessarily save duplicate orders! and create unnecessarily large files. I would only like to save the respective cells to cover each order form individually ie I will require an individual save button located side on to each order form. The forms are already cleared by way of a simple macro to continually re use. Thank you for reading my request Robert |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Create a button in the usual way and assign to it the folllowing macro:
Sub loxley() n = InputBox("Enter customer name: ") n = n & " " & WorksheetFunction.Text(Now(), "ddd_mmm_yyyy__hh_mm") ActiveWorkbook.SaveAs Filename:="C:\archive\product A\" & n End Sub When the button is pressed, the user will be prompted for the customer name. The file will then be save. -- Gary's Student "Robert Loxley" wrote: I am hoping with your programming skills, by way of a coded macro, to save an exel file by operating a button and achieving the following objective automatically... name file as... customer_date_time.xls and save file to specific path for example c:\archive\product A --- please note customer name is variable - which is selected from a drop down list in a specific cell in an order form. date & time is real time The time variable is required and preferable as it is possible for 1 customer to take 2 different products on the same date. One cannot have to two file names the same!. For example : customer A_301006.xls (X2) wont work but customer A_301006_1000.xls and customer A_301006_1005 will save without conflict ---- Background information... I have 3 order forms set out vertically on a single spreadsheet covering 1 specific product. There is more than 1 product! (Product A-Z). All 3 order forms on the Product A spreadsheet are for the same product. All 3 order forms can be used for different customers selected from a drop down list in a specific cell located within the actual order form. The individual orders are only saved to a specific archive product location folder manually at the moment! (example c:\archive\product A) once customer has recieved the product. As all 3 order forms are on 1 spreadsheet I dont want to save all 3 simultaneoulsly, otherwise I will unnecessarily save duplicate orders! and create unnecessarily large files. I would only like to save the respective cells to cover each order form individually ie I will require an individual save button located side on to each order form. The forms are already cleared by way of a simple macro to continually re use. Thank you for reading my request Robert |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you Gary!
Is there any way... 1 - that the customer variable which is available from within my order form can be used automatically to create the complete file name rather than the operator completing that part manually? 2 - as there are 3 order forms located vertically per sheet i preferably would only like to save the 1 order for per save function rather than 3. is there any way only the cell range for each form can be saved? Thank you "Gary''s Student" wrote: Create a button in the usual way and assign to it the folllowing macro: Sub loxley() n = InputBox("Enter customer name: ") n = n & " " & WorksheetFunction.Text(Now(), "ddd_mmm_yyyy__hh_mm") ActiveWorkbook.SaveAs Filename:="C:\archive\product A\" & n End Sub When the button is pressed, the user will be prompted for the customer name. The file will then be save. -- Gary's Student "Robert Loxley" wrote: I am hoping with your programming skills, by way of a coded macro, to save an exel file by operating a button and achieving the following objective automatically... name file as... customer_date_time.xls and save file to specific path for example c:\archive\product A --- please note customer name is variable - which is selected from a drop down list in a specific cell in an order form. date & time is real time The time variable is required and preferable as it is possible for 1 customer to take 2 different products on the same date. One cannot have to two file names the same!. For example : customer A_301006.xls (X2) wont work but customer A_301006_1000.xls and customer A_301006_1005 will save without conflict ---- Background information... I have 3 order forms set out vertically on a single spreadsheet covering 1 specific product. There is more than 1 product! (Product A-Z). All 3 order forms on the Product A spreadsheet are for the same product. All 3 order forms can be used for different customers selected from a drop down list in a specific cell located within the actual order form. The individual orders are only saved to a specific archive product location folder manually at the moment! (example c:\archive\product A) once customer has recieved the product. As all 3 order forms are on 1 spreadsheet I dont want to save all 3 simultaneoulsly, otherwise I will unnecessarily save duplicate orders! and create unnecessarily large files. I would only like to save the respective cells to cover each order form individually ie I will require an individual save button located side on to each order form. The forms are already cleared by way of a simple macro to continually re use. Thank you for reading my request Robert |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Lets assume that the customer name is in Cell A1, then:
Sub loxley() n = Range(A1).Value n = n & " " & WorksheetFunction.Text(Now(), "ddd_mmm_yyyy__hh_mm") ActiveWorkbook.SaveAs Filename:="C:\archive\product A\" & n End Sub You can change the A1 to the proper cell. With regard to your second question, I dont know. -- Gary's Student "Robert Loxley" wrote: Thank you Gary! Is there any way... 1 - that the customer variable which is available from within my order form can be used automatically to create the complete file name rather than the operator completing that part manually? 2 - as there are 3 order forms located vertically per sheet i preferably would only like to save the 1 order for per save function rather than 3. is there any way only the cell range for each form can be saved? Thank you "Gary''s Student" wrote: Create a button in the usual way and assign to it the folllowing macro: Sub loxley() n = InputBox("Enter customer name: ") n = n & " " & WorksheetFunction.Text(Now(), "ddd_mmm_yyyy__hh_mm") ActiveWorkbook.SaveAs Filename:="C:\archive\product A\" & n End Sub When the button is pressed, the user will be prompted for the customer name. The file will then be save. -- Gary's Student "Robert Loxley" wrote: I am hoping with your programming skills, by way of a coded macro, to save an exel file by operating a button and achieving the following objective automatically... name file as... customer_date_time.xls and save file to specific path for example c:\archive\product A --- please note customer name is variable - which is selected from a drop down list in a specific cell in an order form. date & time is real time The time variable is required and preferable as it is possible for 1 customer to take 2 different products on the same date. One cannot have to two file names the same!. For example : customer A_301006.xls (X2) wont work but customer A_301006_1000.xls and customer A_301006_1005 will save without conflict ---- Background information... I have 3 order forms set out vertically on a single spreadsheet covering 1 specific product. There is more than 1 product! (Product A-Z). All 3 order forms on the Product A spreadsheet are for the same product. All 3 order forms can be used for different customers selected from a drop down list in a specific cell located within the actual order form. The individual orders are only saved to a specific archive product location folder manually at the moment! (example c:\archive\product A) once customer has recieved the product. As all 3 order forms are on 1 spreadsheet I dont want to save all 3 simultaneoulsly, otherwise I will unnecessarily save duplicate orders! and create unnecessarily large files. I would only like to save the respective cells to cover each order form individually ie I will require an individual save button located side on to each order form. The forms are already cleared by way of a simple macro to continually re use. Thank you for reading my request Robert |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Gary
i replaced the macro with your suggestion following message appeared... run time error '1004' method 'range' of object' global failed. first line of code highlighed in yellow color - thats on the line with the cell reference does that mean anything to you? thank you "Gary''s Student" wrote: Lets assume that the customer name is in Cell A1, then: Sub loxley() n = Range(A1).Value n = n & " " & WorksheetFunction.Text(Now(), "ddd_mmm_yyyy__hh_mm") ActiveWorkbook.SaveAs Filename:="C:\archive\product A\" & n End Sub You can change the A1 to the proper cell. With regard to your second question, I dont know. -- Gary's Student "Robert Loxley" wrote: Thank you Gary! Is there any way... 1 - that the customer variable which is available from within my order form can be used automatically to create the complete file name rather than the operator completing that part manually? 2 - as there are 3 order forms located vertically per sheet i preferably would only like to save the 1 order for per save function rather than 3. is there any way only the cell range for each form can be saved? Thank you "Gary''s Student" wrote: Create a button in the usual way and assign to it the folllowing macro: Sub loxley() n = InputBox("Enter customer name: ") n = n & " " & WorksheetFunction.Text(Now(), "ddd_mmm_yyyy__hh_mm") ActiveWorkbook.SaveAs Filename:="C:\archive\product A\" & n End Sub When the button is pressed, the user will be prompted for the customer name. The file will then be save. -- Gary's Student "Robert Loxley" wrote: I am hoping with your programming skills, by way of a coded macro, to save an exel file by operating a button and achieving the following objective automatically... name file as... customer_date_time.xls and save file to specific path for example c:\archive\product A --- please note customer name is variable - which is selected from a drop down list in a specific cell in an order form. date & time is real time The time variable is required and preferable as it is possible for 1 customer to take 2 different products on the same date. One cannot have to two file names the same!. For example : customer A_301006.xls (X2) wont work but customer A_301006_1000.xls and customer A_301006_1005 will save without conflict ---- Background information... I have 3 order forms set out vertically on a single spreadsheet covering 1 specific product. There is more than 1 product! (Product A-Z). All 3 order forms on the Product A spreadsheet are for the same product. All 3 order forms can be used for different customers selected from a drop down list in a specific cell located within the actual order form. The individual orders are only saved to a specific archive product location folder manually at the moment! (example c:\archive\product A) once customer has recieved the product. As all 3 order forms are on 1 spreadsheet I dont want to save all 3 simultaneoulsly, otherwise I will unnecessarily save duplicate orders! and create unnecessarily large files. I would only like to save the respective cells to cover each order form individually ie I will require an individual save button located side on to each order form. The forms are already cleared by way of a simple macro to continually re use. Thank you for reading my request Robert |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry, it also failed for me. This works:
Sub loxley() Dim n As String Dim r As Range Set r = Cells(1, 1) n = r.Value n = n & " " & WorksheetFunction.Text(Now(), "ddd_mmm_yyyy__hh_mm") ActiveWorkbook.SaveAs Filename:="C:\archive\product A\" & n End Sub -- Gary''s Student "Robert Loxley" wrote: Thanks Gary i replaced the macro with your suggestion following message appeared... run time error '1004' method 'range' of object' global failed. first line of code highlighed in yellow color - thats on the line with the cell reference does that mean anything to you? thank you "Gary''s Student" wrote: Lets assume that the customer name is in Cell A1, then: Sub loxley() n = Range(A1).Value n = n & " " & WorksheetFunction.Text(Now(), "ddd_mmm_yyyy__hh_mm") ActiveWorkbook.SaveAs Filename:="C:\archive\product A\" & n End Sub You can change the A1 to the proper cell. With regard to your second question, I dont know. -- Gary's Student "Robert Loxley" wrote: Thank you Gary! Is there any way... 1 - that the customer variable which is available from within my order form can be used automatically to create the complete file name rather than the operator completing that part manually? 2 - as there are 3 order forms located vertically per sheet i preferably would only like to save the 1 order for per save function rather than 3. is there any way only the cell range for each form can be saved? Thank you "Gary''s Student" wrote: Create a button in the usual way and assign to it the folllowing macro: Sub loxley() n = InputBox("Enter customer name: ") n = n & " " & WorksheetFunction.Text(Now(), "ddd_mmm_yyyy__hh_mm") ActiveWorkbook.SaveAs Filename:="C:\archive\product A\" & n End Sub When the button is pressed, the user will be prompted for the customer name. The file will then be save. -- Gary's Student "Robert Loxley" wrote: I am hoping with your programming skills, by way of a coded macro, to save an exel file by operating a button and achieving the following objective automatically... name file as... customer_date_time.xls and save file to specific path for example c:\archive\product A --- please note customer name is variable - which is selected from a drop down list in a specific cell in an order form. date & time is real time The time variable is required and preferable as it is possible for 1 customer to take 2 different products on the same date. One cannot have to two file names the same!. For example : customer A_301006.xls (X2) wont work but customer A_301006_1000.xls and customer A_301006_1005 will save without conflict ---- Background information... I have 3 order forms set out vertically on a single spreadsheet covering 1 specific product. There is more than 1 product! (Product A-Z). All 3 order forms on the Product A spreadsheet are for the same product. All 3 order forms can be used for different customers selected from a drop down list in a specific cell located within the actual order form. The individual orders are only saved to a specific archive product location folder manually at the moment! (example c:\archive\product A) once customer has recieved the product. As all 3 order forms are on 1 spreadsheet I dont want to save all 3 simultaneoulsly, otherwise I will unnecessarily save duplicate orders! and create unnecessarily large files. I would only like to save the respective cells to cover each order form individually ie I will require an individual save button located side on to each order form. The forms are already cleared by way of a simple macro to continually re use. Thank you for reading my request Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autoname a save as file from a cell in a read only file | Excel Discussion (Misc queries) | |||
I can not save archive file in excel | Excel Discussion (Misc queries) | |||
Automatic Populate Todays Date in Cell when File is Saved. | Excel Discussion (Misc queries) | |||
Excel file modification date | Excel Discussion (Misc queries) | |||
Weekly Transaction Processing | Excel Worksheet Functions |