VBA to move multiple worksheets

Help007

New Member
Joined
Dec 16, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello all,
Can someone please help with some code?
I would like to move every other worksheet in a workbook to the end.
So if I had 10 worksheets I would need the code to move Sheet2, 4, 6, & 8 before Sheet 10.
My Workbook sheet order would now be Sheet1, 3, 5, 7, 9, 2, 4, 6, 8, 10. The number of sheets will always end on an even number but could easily go to 100 sheets. Just thought start with 10.
It would need to loop I guess until it finds the last even numbered sheet I guess moving every other (odd numbered) sheet it. But keep order so if 10 worksheets move Sheet 8 before sheet 10 first and work backwards.
Unless you can get it to multi select the odd numbered sheets and do it at once.
Hope someone can help :)
Thanks in advance.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi & welcome to MrExcel.
What version of Excel are you using, it can't be all of them?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Thanks for updating your profile.
How about
VBA Code:
Sub Help()
   Dim Ary As Variant
   Ary = Evaluate("sequence(," & Sheets.Count & "/2,2,2)")
   Sheets(Ary).Move Sheets(Sheets.Count)
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,411
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top