product date stamp file save
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
|