• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

saving file as

ysherriff

Member
Hello all,

I have a template that i need to "save as" based on the reporting date. It is not working for some reason. Can you please see where i have coded incorrectly.

Attached is the file and below is the code:

Sub WBKDUP()
Dim i As Integer
Dim fname As String, path As String
Dim reportdate As String
i = 6
path = ThisWorkbook.path
reportdate = Range("Current_Month")
Do While Sheets("control").Cells(i, 2).Value <> ""
fname = Sheets("control").Cells(i, 2).Value
Range("DC_NAME") = fname
Sheets("DirectConnect Summary").Cells(2, "f").Value = fname & " DirectConnect Summary Report"
ActiveWorkbook.SaveAs path & "\" & fname & " DirectConnect " & reportdate & " Report.xls"
i = i + 1
Loop

ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub
 

Attachments

Back
Top