Hi, everyone!
I'm new user of VBA and I have a problems with a code that I wrote:
Sub Main()
Const strRootFolder As String = "M:\Production\Masters\2017\Normalization"
Dim strFolder As String
strFolder = "M:\Production\Masters\2017\Normalization\" & Range("sheet_name").Value
If Dir(strFolder, vbDirectory) = "" Then
MkDir strFolder
End If
Dim New_Wb As Workbook
Set New_Wb = Workbooks.Add
New_Wb.Activate
New_Wb.SaveAs ("M:\Production\Masters\2017\Normalization\" & Range("sheet_name").Value & "\" & Range("Book"))
Windows("Normalization counting.xlsm").Activate
End Sub
Th error debugs to the line
New_Wb.SaveAs ("M:\Production\Masters\2017\Normalization\" & Range("sheet_name").Value & "\" & Range("Book"))
Please, I really need your help!
P.S. sorry for mistakes I may have. I'm not native speaker
I'm new user of VBA and I have a problems with a code that I wrote:
Sub Main()
Const strRootFolder As String = "M:\Production\Masters\2017\Normalization"
Dim strFolder As String
strFolder = "M:\Production\Masters\2017\Normalization\" & Range("sheet_name").Value
If Dir(strFolder, vbDirectory) = "" Then
MkDir strFolder
End If
Dim New_Wb As Workbook
Set New_Wb = Workbooks.Add
New_Wb.Activate
New_Wb.SaveAs ("M:\Production\Masters\2017\Normalization\" & Range("sheet_name").Value & "\" & Range("Book"))
Windows("Normalization counting.xlsm").Activate
End Sub
Th error debugs to the line
New_Wb.SaveAs ("M:\Production\Masters\2017\Normalization\" & Range("sheet_name").Value & "\" & Range("Book"))
Please, I really need your help!
P.S. sorry for mistakes I may have. I'm not native speaker