Macro to drag sheet forward by 1

Tuckejam

Board Regular
Joined
Oct 15, 2013
Messages
81
So im currently working with this work book that copys a set of columns from the summary worksheet then CTRL+pg down (to next worksheet) and pastes the data.

this works well but i need to then drag the summary worksheed to the next positon and run the macro again.

every time i try to record me draging the summary worksheet up one (using absolut or relitive) it shows the same (see below)

Code:
Sub Macro6()
'
' Macro6 Macro
'
'
    Sheets("Summary").Select
    Sheets("Summary").Move Before:=Sheets(10)
    Sheets("Summary").Select
    Sheets("Summary").Move Before:=Sheets(11)
End Sub

any way to make that Sheets("Summary").Move AHEAD ONE

or something like that?

thaks in advance for any help
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Momentman

Well-known Member
Joined
Jan 11, 2012
Messages
4,066
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Something like this maybe
Code:
If Sheets("Summary").Index < ActiveWorkbook.Worksheets.Count Then
        Sheets("Summary").Move after:=Sheets(Sheets("Summary").Index + 1)
End If
 

Watch MrExcel Video

Forum statistics

Threads
1,122,670
Messages
5,597,482
Members
414,144
Latest member
UDFNewbie

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
Top