LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #34   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Copy adjacent Sheet and name from a list

Hi Howard,

Am Tue, 9 Apr 2013 10:36:06 -0700 (PDT) schrieb Howard:

I'm thinking I see a problem when I select from a list of 10 names,
say the 4th, 7th, 9th and run delete code it kinda messes up, but I need to gather real specifics before I come to you with that. Using single digit numbers as sheet names may also be a problem. But applying strict do's and don't rules for use of codes to the end user seems reasonable to me.


you also can dump the selected cells in an array, group the sheets with
the selected names and delete them at once:

Sub ShDelete()
Dim i As Integer
Dim myArr() As Variant
Dim rngC As Range

Application.DisplayAlerts = False
ReDim myArr(Selection.Cells.Count - 1)
For Each rngC In Selection
myArr(i) = rngC.Text
rngC.Resize(, 5).ClearContents
i = i + 1
Next
Sheets(myArr()).Select
ActiveWindow.SelectedSheets.Delete
Range("C8:G32").Sort key1:=[C9], order1:=xlAscending, _
Header:=xlYes
Application.DisplayAlerts = True
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
 
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
i have a list i need to copy onto another sheet one by one bigsister Excel Discussion (Misc queries) 2 March 25th 10 10:55 PM
find IDs in another sheet, copy paste non-adjacent data on orig sh Shariq Excel Programming 2 September 17th 09 06:10 PM
Copy Paste from Class Sheet to Filtered List on Combined Sheet [email protected] Excel Programming 6 September 16th 08 04:30 PM
When data match, copy adjacent value to adjacent column slimbim Excel Worksheet Functions 2 November 8th 06 08:41 PM
how to find and copy values on sheet 2, based on a list on sheet 1 evanmacnz Excel Programming 4 February 7th 05 08:33 PM


All times are GMT +1. The time now is 04:09 PM.

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

About Us

"It's about Microsoft Excel"