Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default sorting and deleting sheets

i will be grateful for a piece of code to sort all the sheets in a workbook,
say to the left of a certain sheet, and also a piece of code to delete all
the worksheets say to the right of a certain sheet.

I am sure this must have been asked before but i cannot find it in the forum
--
with kind regards

Spike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default sorting and deleting sheets

You probably should delete the sheets first, then sort the rest - or vice
versa - depending on the functionality you want. To delete sheets from the
right side of the tab order:

for i = worksheets.count to 5 step -1
Application.displayAlerts = False
Worksheets(i).Delete
Application.DisplayAlerts = True
Next

to sort sheets in the tab order you can use code like this at Chip Pearson's
site:
http://www.cpearson.com/excel/sortws.htm

--
Regards,
Tom Ogilvy


"Spike" wrote:

i will be grateful for a piece of code to sort all the sheets in a workbook,
say to the left of a certain sheet, and also a piece of code to delete all
the worksheets say to the right of a certain sheet.

I am sure this must have been asked before but i cannot find it in the forum
--
with kind regards

Spike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default sorting and deleting sheets

excellent many thanks
--
with kind regards

Spike


"Tom Ogilvy" wrote:

You probably should delete the sheets first, then sort the rest - or vice
versa - depending on the functionality you want. To delete sheets from the
right side of the tab order:

for i = worksheets.count to 5 step -1
Application.displayAlerts = False
Worksheets(i).Delete
Application.DisplayAlerts = True
Next

to sort sheets in the tab order you can use code like this at Chip Pearson's
site:
http://www.cpearson.com/excel/sortws.htm

--
Regards,
Tom Ogilvy


"Spike" wrote:

i will be grateful for a piece of code to sort all the sheets in a workbook,
say to the left of a certain sheet, and also a piece of code to delete all
the worksheets say to the right of a certain sheet.

I am sure this must have been asked before but i cannot find it in the forum
--
with kind regards

Spike

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting/Sorting Karen Excel Worksheet Functions 8 July 28th 08 09:08 PM
Sorting and Deleting Help LOU Excel Worksheet Functions 2 August 28th 07 09:42 PM
Deleting data by sorting dates drc Excel Discussion (Misc queries) 1 October 2nd 06 06:33 PM
Sorting and deleting empty cells asianmike Excel Discussion (Misc queries) 0 January 30th 06 05:08 PM
Deleting Sheets Jordan[_3_] Excel Programming 4 February 13th 04 03:19 PM


All times are GMT +1. The time now is 07:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"