Excluding Worksheets from a Workbook Copy

WxShady13

Board Regular
Joined
Jul 24, 2018
Messages
185
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I have a workbook that has 3 static worksheets that are named the same in every workbook. The additional worksheets are dynamically created based on the employee name and training record selected by the supervisor. I need to copy a range of data on every worksheet but the 3 static ones (***NOTE I do not know the last row for each worksheet), onto one master worksheet so that I can then create a chart. I have the code where it will copy all the worksheets, but how do I remove the 3 static ones?
 
Question...The code you provided pastes the formula, I just need it to paste the values. I know I can use the PasteSpecial xl PasteValues but how do I incorporate this with the code you provided?
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
This amendement to Fluff's code will paste values, and number formats if required.
Code:
Sub ttt()
   Dim i As Long
   For i = 5 To Worksheets.Count
      With Sheets(i)
         .Range("A1:G70").Copy 
         Sheets("Summary").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValuesAndNumberFormats
      End With
   Next i
End Sub
 
Upvote 0
Not to throw a wrench in the code but I was using additional code to remove the headers when it came over so it all was a clean list. With the new code it will not remove the headers (Rows 1 & 2) from each worksheet it copies. What can I do to remove those?
 
Upvote 0
Make this change
Code:
.Range("A[COLOR=#ff0000]3[/COLOR]:G70").Copy
 
Upvote 0
Thank you again...You all truly do not know how grateful I am for your help...
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top