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
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Something like this maybe
Code:
If Sheets("Summary").Index < ActiveWorkbook.Worksheets.Count Then
        Sheets("Summary").Move after:=Sheets(Sheets("Summary").Index + 1)
End If
 
Upvote 0

Forum statistics

Threads
1,215,527
Messages
6,125,334
Members
449,218
Latest member
Excel Master

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