F
FLORERO
I am working with a workbook that has over 40 tabs (worksheets). Each
worksheet is a department report and the last report is the one I need to
select for each department and copy it into a new workbook. The name of the
worksheets to be selected copied and pasted is "xxxxx-RSS Upload" where x is
the department number. I was trying to find a property that could only select
the "Upload" part of the worksheet name as a common denominator to select
multiple worksheets that end with that text string. Can somebody provide a
code that will do this??? I started of like this but cannot come up with a
condition:
Sub macro1_()
Dim ws As Worksheet
For Each ws In Worksheets
If ws. 'contains Upload at the end of the text string
ws.Activate
ws.Select
ws.copy After:= workbooks("NewBook").'how do I paste it as the last
worksheet?
End If
Next ws
End Sub
Thanks in advance for your help
worksheet is a department report and the last report is the one I need to
select for each department and copy it into a new workbook. The name of the
worksheets to be selected copied and pasted is "xxxxx-RSS Upload" where x is
the department number. I was trying to find a property that could only select
the "Upload" part of the worksheet name as a common denominator to select
multiple worksheets that end with that text string. Can somebody provide a
code that will do this??? I started of like this but cannot come up with a
condition:
Sub macro1_()
Dim ws As Worksheet
For Each ws In Worksheets
If ws. 'contains Upload at the end of the text string
ws.Activate
ws.Select
ws.copy After:= workbooks("NewBook").'how do I paste it as the last
worksheet?
End If
Next ws
End Sub
Thanks in advance for your help