DouglasWicker
New Member
- Joined
- Aug 8, 2017
- Messages
- 38
Morning All,
I have a workbook that consists of 1000+ sheets. They all have a weekday and a duplicate number as their sheet names. e.g Monday 12, Tuesday 15, Sunday 34 etc. THey are not in order of days. I'm trying to use vba to move all sheets containing "Monday" into a new workbook so will then Only have Mondays in that workbook.
I currently have this code but am getting debug errors on the ActiveSheet.Move line.
I have a workbook that consists of 1000+ sheets. They all have a weekday and a duplicate number as their sheet names. e.g Monday 12, Tuesday 15, Sunday 34 etc. THey are not in order of days. I'm trying to use vba to move all sheets containing "Monday" into a new workbook so will then Only have Mondays in that workbook.
I currently have this code but am getting debug errors on the ActiveSheet.Move line.
Code:
Sub MoveMondays()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
If ws.Name Like "Monday*" Then
ActiveSheet.Move Before:=Workbooks("Monday Test.xlsx").Sheets(1)
End If
Next ws
End Sub
Last edited by a moderator: