halimi1306
08-03-2011, 08:10 PM
Hi,
How to add few more sheet name to this code i.e I want to add 2 more sheet with name "Labour - summary" and "Overall - Summary", or is there any way to get the sheet referring to their part of name such as " - summary". Any sheet have this part of name will be selected.
Thanks,
For Each ws In wb.Sheets
If ws.Name = "GNI - summary" _
Or ws.Name = "Capital - summary" Then
ws.Copy Before:=wbThisBk.Sheets("End")
Range("A1:AZ1000").Select
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
Next ws
How to add few more sheet name to this code i.e I want to add 2 more sheet with name "Labour - summary" and "Overall - Summary", or is there any way to get the sheet referring to their part of name such as " - summary". Any sheet have this part of name will be selected.
Thanks,
For Each ws In wb.Sheets
If ws.Name = "GNI - summary" _
Or ws.Name = "Capital - summary" Then
ws.Copy Before:=wbThisBk.Sheets("End")
Range("A1:AZ1000").Select
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
Next ws