Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here's some simple code
Dim i As Long Dim fOrder As Boolean Do fOrder = True For i = 1 To Worksheets.Count - 1 If Worksheets(i).Range("C1").Value _ Worksheets(i + 1).Range("C1").Value Then Worksheets(i).Move after:=Worksheets(i + 1) fOrder = False End If Next i Loop Until fOrder -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "neowok " wrote in message ... I have 22 sheets with dientical layouts in a workbook. what i need is a macro fo some kind that will re-order the sheets in the workbook based on the value in a particular cell (it will be the same cell in each of the sheets). Basicallly I have 3 sets of dates on these sheets and i need to be able to order the sheets in the workbook based on which one of these dates I need to sort by at the time (basically putting the earliest dates at the front). A macro that will sort the 22 sheets putting the earliest date in C1 at the start would do. If i then need to order them by E1 instead then I'll only have to change a tiny bit in the macro. Thanks --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to hide sheets based upon cell value | Excel Discussion (Misc queries) | |||
change order of 5 letter word based on another cell containing 5 numbers | Excel Worksheet Functions | |||
Hide sheets based on Cell value | Excel Discussion (Misc queries) | |||
Daily Macro to Download Data, Order and paste in order | Excel Worksheet Functions | |||
Unhide sheets based on a cell value | Excel Programming |