I am getting a runtime 13 error type mismatch when I run this macro. The call out is "if... then".
The code seemingly works correctly. The only issue I can think of is that a seperate macro runs before this one that uses a formula to name cells(1,8) and then a copy, paste values occurs.
Sub NewWb()
Set wb1 = ThisWorkbook
Set wb2 = Workbooks.Add
For Each Worksheet In wb1.Worksheets
**If Worksheet.Cells(1, 8).Value = "PI Fin Ops" Then**
Worksheet.Move After:=wb2.Sheets(wb2.Sheets.Count)
End If
Next Worksheet
End Sub
Any help is appreciated!