View Single Post
  #27   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Copy adjacent Sheet and name from a list

Hi Garry,

Am Mon, 08 Apr 2013 14:38:11 -0400 schrieb GS:

If Sheets(vNames(n, 1)) Is Nothing Then


you will get an error ^^^^^^

Sub CopyMainSwb()
Dim arrNames, n As Integer

Application.ScreenUpdating = False
With Sheets("Summary")
arrNames = .Range("C9:C32").SpecialCells(xlCellTypeConstants)

For n = LBound(arrNames) To UBound(arrNames)
On Error Resume Next
If Sheets(arrNames(n, 1)) Is Nothing Then
Sheets("Main Swb").Copy befo=Sheets("NOTES")
ActiveSheet.Name = arrNames(n, 1)
.Range("C9:C32").SpecialCells(xlCellTypeConstants) _
.Cells(n).Offset(, 1).Resize(1, 4) = _
"='" & arrNames(n, 1) & "'!G7"
End If
Next
End With
Application.ScreenUpdating = True
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2