Getting control variable in use for this, I guess because of "ws", can someone help how to fix? Thanks
Sub CreateNewWBS()
Dim wbThis As Workbook
Dim wbNew As Workbook
Dim ws As Worksheet
Dim strFilename As String
Set wbThis = ThisWorkbook
For Each ws In wbThis.Worksheets
strFilename = wbThis.Path & "/" & ws.Name
ws.Copy
Set wbNew = ActiveWorkbook
For Each ws In wbNew.Worksheets
ws.Cells.Copy
ws.Cells.PasteSpecial xlPasteValues
wbNew.SaveAs strFilename
wbNew.Close
Next ws
End Sub
Dim ws2 as Worksheetand use that instead? Also you're missing aNext.wbThis? Surely, it is justThisWorkbook, which will not (and literally can not) change during the macro execution?ws2and you don'tSetanything.For Each ws2 in wbNew.Worksheets,ws2.Cells.Copy,ws2.Cells.PasteSpecial xlPasteValues.