Hi,
I have a set of workbooks which all contain a worksheet called "Data". I need to move this worksheet to the beginning of each workbook. I'd like to set up a macro to do this for all workbooks simultaneously.
I have the following code, but it only seems to move the worksheet in the currently active workbook, and doesn't move on to the next workbook.
What am I missing?
I have a set of workbooks which all contain a worksheet called "Data". I need to move this worksheet to the beginning of each workbook. I'd like to set up a macro to do this for all workbooks simultaneously.
I have the following code, but it only seems to move the worksheet in the currently active workbook, and doesn't move on to the next workbook.
Code:
Sub MoveData()
Dim wb As Workbook
For Each wb In Workbooks
Worksheets("Data").Move Before:=Worksheets(1)
Next wb
End Sub
What am I missing?