Hi,
Using posts from other threads, I was able to cobble together some code that took the current sheet, exported it to a new workbook, then saved that workbook in a folder based on a cell name, and saved the filename based on a combination of two cells.
This was working fine last night, but not so this morning. The error that comes up is "400".
The code is below.
Sub newexport()
Dim wb As Workbook
Worksheets("Exercise Plan").Copy
Set wb = ActiveWorkbook
wb.SaveAs Filename:=("C:\Lauren\" & Sheets("Exercise Plan").Range("a2").Value & "\" & "Exercise Plan" & " " & Sheets("Exercise Plan").Range("a2").Value & " " & Sheets("Exercise Plan").Range("c3").Value)
wb.Close
End Sub
A2: Cell specifying name
C3: Cell specifying program number
So the filename should read something like: C:\Lauren\Joe Smith\Exercise Plan Joe Smith 12.xls
Thanks for your help!
Bookmarks