Hi all
I don't have much experience with VBA, but I've been able to find most formulas I want with a quick search, and some slight modification. I'm a bit stuck on this one though.
I have a section of code below, which creates a new workbook based off an excel template, and saves it as a new workbook named after a cell.
What I would like it to also do, is to create a new folder (named after a cell in the original workbook which contains the macro) and save the new workbook in that folder. So every time the macro is clicked, a new workbook and subfolder is created, within my quotes folder. Hopefully that makes sense.
Thanks in advance for the help, these forums are great.
I don't have much experience with VBA, but I've been able to find most formulas I want with a quick search, and some slight modification. I'm a bit stuck on this one though.
I have a section of code below, which creates a new workbook based off an excel template, and saves it as a new workbook named after a cell.
What I would like it to also do, is to create a new folder (named after a cell in the original workbook which contains the macro) and save the new workbook in that folder. So every time the macro is clicked, a new workbook and subfolder is created, within my quotes folder. Hopefully that makes sense.
Code:
' Create new job template
Dim wB As Workbook
Dim nPath As String
nPath = "I:\Mark B\New Job Template Resources\Quotes\" & ThisWorkbook.Sheets("Leads").Range("B23").Value
Set wB = Workbooks.Add("I:\Mark B\New Job Template Resources\Custom Office Templates\Job Template.xltm")
With wB
.SaveAs Filename:=nPath & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled
End With
Thanks in advance for the help, these forums are great.