sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,422
- Office Version
- 2016
- Platform
- Windows
Can anyone show me how I can copy 2 specific worksheets to a new workbook but without the macros attached to them?
I can copy a sheet to a new workbook fine, I can rename the sheet fine, but I'm struggling to do it with 2 sheets. This is what I have so far which works fine for 1 sheet:
What I need in full is;
1) Copy the sheets to a new workbook (without code)
2) Rename each of the sheets in the new workbook (to a name yet to be decided)
3) Save the new workbook with a new name as an xlsx file and then close
I can copy a sheet to a new workbook fine, I can rename the sheet fine, but I'm struggling to do it with 2 sheets. This is what I have so far which works fine for 1 sheet:
Code:
ReportDate = Format(Now, "dd_mm_yy_hh_mm")
Fname = ThisWorkbook.path & "\Reports\121 Manager Report_" & ReportDate & ".xlsx"
Sheets("MANAGERS").Copy
For Each ws In ActiveWorkbook.Worksheets
With ws.UsedRange
.Value = .Value
End With
Next ws
With ActiveWorkbook
Sheets("MANAGERS").Name = "121_MANAGERS_" & ReportDate
.SaveAs FileName:=Fname
.Close
End With
What I need in full is;
1) Copy the sheets to a new workbook (without code)
2) Rename each of the sheets in the new workbook (to a name yet to be decided)
3) Save the new workbook with a new name as an xlsx file and then close