ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Moving sheets in code (https://www.excelbanter.com/excel-programming/410194-moving-sheets-code.html)

Ayo

Moving sheets in code
 
I want to perform the action in the code line below:

Worksheets("Clusters Summary Report").Move befo=Worksheets("Cluster 1")

This works fine, but the problem is "Cluster 1" is not always going to be
the first worksheet inj the workbook. I am looking for a say to tell the code
to move sheet "Clusters Summary Report" into the first position in the
workbook so that the first worksheet in the workbook is "Clusters Summary
Report".
Is there a way to do this?

Jim Thomlinson

Moving sheets in code
 
Worksheets("Clusters Summary Report").Move befo=Worksheets(1)

--
HTH...

Jim Thomlinson


"Ayo" wrote:

I want to perform the action in the code line below:

Worksheets("Clusters Summary Report").Move befo=Worksheets("Cluster 1")

This works fine, but the problem is "Cluster 1" is not always going to be
the first worksheet inj the workbook. I am looking for a say to tell the code
to move sheet "Clusters Summary Report" into the first position in the
workbook so that the first worksheet in the workbook is "Clusters Summary
Report".
Is there a way to do this?


Gord Dibben

Moving sheets in code
 
Worksheets("Clusters Summary Report").Move befo=Sheets(1)


Gord Dibben MS Excel MVP

On Tue, 29 Apr 2008 12:45:02 -0700, Ayo wrote:

I want to perform the action in the code line below:

Worksheets("Clusters Summary Report").Move befo=Worksheets("Cluster 1")

This works fine, but the problem is "Cluster 1" is not always going to be
the first worksheet inj the workbook. I am looking for a say to tell the code
to move sheet "Clusters Summary Report" into the first position in the
workbook so that the first worksheet in the workbook is "Clusters Summary
Report".
Is there a way to do this?




All times are GMT +1. The time now is 10:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com