List of File Saved

M

maperalia

I have a program that save an excel file with specific "file name" and path
(see below). However, I want to know if this file name can be archived in one
spreadsheet.
For example, as soon the file is saved, this file name will be typed in the
cell A2 of the excel file "C:\List.xls". Then if another file is saved it
will be typed in the cell A3 and so on. Therefore, all the files name saved
will be located under the "column A" only

I wonder if this is possible to do it. Could you please tell me how?

Thanks in advance
Maperalia


Option Explicit
Sub SaveExcelFile()
Dim boError As Boolean
Dim strError As String
Dim Tract As String
Dim WO As String
Dim Supplier As String
Dim Dates As String
Dim Time As String
Dim sFilename As String
Dim Progname As String



strError = ""
boError = False
With Worksheets("Gradation Form")
If .Range("G2") = "" Then
boError = True
strError = strError & "WORK ORDER # "
End If
If .Range("G3") = "" Then
boError = True
strError = strError & "TRACT #"
End If
If .Range("C6") = "" Then
boError = True
strError = strError & "SUPPLIER "
End If
If .Range("G4") = "" Then
boError = True
strError = strError & "DATE "
End If
If .Range("G5") = "" Then
boError = True
strError = strError & "TIME"
End If
If boError = True Then
MsgBox "The Following Ranges have not been Typed Yet - " & strError
Exit Sub
Else


WO = Worksheets("Gradation Form").Range("G2")
Tract = Worksheets("Gradation Form").Range("G3")
Supplier = Worksheets("Gradation Form").Range("C6")
Dates = Worksheets("Gradation Form").Range("G4")
Time = Worksheets("Gradation Form").Range("G5")


Progname = "C:\Mario\VB\Excel\" & WO & "_" & Tract & "_" & Supplier &
"_" & Dates & "_" & Time & ".xls"
ActiveWorkbook.SaveCopyAs Progname
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top