Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I have a series of identical sheets named LN1, LN2 etc up to LN20. They are sandwiched between sheets "start" & "end" and each cell is summed using =SUM(LN1:Ln2!A1) etc. The user has been given the functionality to remove (say LN2, LN3, LN4) from the protfolio by moving the sheets outside the "start" & "end" sandwich. The problem l am having is writing some code to re-insert the sheets between "start" & "end" and keep the numerical order intact. Has anybody got any ideas? All suggestions gratefully received Regards Michael beckinsale |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This will do it for the references you gave.....
Sub SortSheets() Dim xs As Integer Application.ScreenUpdating = False Sheets("LN1").Move After:=Sheets("start") For xs = 1 To 19 Sheets("LN" & xs + 1).Move After:=Sheets("LN" & xs) Next Sheets("end").Move After:=Sheets("LN20") Application.ScreenUpdating = True End Sub -- Cheers Nigel "Michael Beckinsale" wrote in message ... Hi All, I have a series of identical sheets named LN1, LN2 etc up to LN20. They are sandwiched between sheets "start" & "end" and each cell is summed using =SUM(LN1:Ln2!A1) etc. The user has been given the functionality to remove (say LN2, LN3, LN4) from the protfolio by moving the sheets outside the "start" & "end" sandwich. The problem l am having is writing some code to re-insert the sheets between "start" & "end" and keep the numerical order intact. Has anybody got any ideas? All suggestions gratefully received Regards Michael beckinsale |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Moving Formulas when Sorting | Excel Discussion (Misc queries) | |||
Moving Formulas when Sorting a table | Excel Discussion (Misc queries) | |||
Moving Data between sheets in the same workbook and moving data between Workbooks. | Excel Worksheet Functions | |||
Sorting/Moving Data | Excel Worksheet Functions | |||
Sorting/Moving | Excel Discussion (Misc queries) |