View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Copy adjacent Sheet and name from a list

I tried to have a look at your file but it was no longer there!

While certain that Claus provided an excellent solution, I offer a
version that doesn't loop each range on "Summary" for the names of the
copied sheets.

Sub CopyAndNameSheets()
Dim vNames, n&, lRow&
With Sheets("Summary")
lRow = .Cells(.Rows.Count, 3).End(xlUp).Row
vNames = .Range("C1:C" & lRow)
End With
For n = LBound(vNames) To UBound(vNames)
Sheets("Main Swb").Copy after:=Sheets("Main Swb")
ActiveSheet.Name = vNames(n, 1)
Next 'n
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion