QC Excel Reports – Post Processing – Move Worksheet
Question ID: 104365
3
0

Does anyone have an example of how to use post processing to move a worksheet to the first or last position?
Thanks in Advance.

Marked as spam
Posted by (Questions: 23, Answers: 1)
Asked on May 12, 2011 6:31 pm
51 views
Answers (1)
3
Private answer

Here are a couple of examples you can try in your post processing.

1) Move First worksheet to Last - Call Subroutine ''Move_First_to_Last''

2) Move Last worksheet to First - Call Subroutine ''Move_Last_to_First''

The example come from http://support.microsoft.com/kb/288402

=====================================

Sub Move_Last_to_First()

GotoLastSheet

Move_First

End Sub

Sub Move_First_to_Last()

GotoFirstSheet

Move_Last

End Sub

Sub GotoLastSheet() 'Finds Last Sheet

Dim i&

For i = Sheets.Count To 1 Step -1

If Sheets(i).Visible And TypeName(Sheets(i)) <> ''Module'' Then

Sheets(i).Select

Exit Sub

End If

Next i

End Sub

Sub GotoFirstSheet() 'Finds First Sheet

Dim i&

For i = 1 To Sheets.Count

If Sheets(i).Visible And TypeName(Sheets(i)) <> ''Module'' Then

Sheets(i).Select

Exit Sub

End If

Next i

End Sub

Sub Move_Last() 'Move Current Sheet to Last

ActiveSheet.Move _

After:=ActiveWorkbook.Sheets(ActiveWorkbook.Sheets.Count)

'Moves active sheet to end of active workbook.

End Sub

Sub Move_First() 'Move Current Sheet to First

ActiveSheet.Move _

Before:=ActiveWorkbook.Sheets(1)

'Moves active sheet to end of active workbook.

End Sub

Marked as spam
Posted by (Questions: 0, Answers: 613)
Answered on May 12, 2011 6:44 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top