Copy and save specific sheet as a separate worksheet xlsx

trpltwo

New Member
Joined
Jan 18, 2023
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi all, thanks in advance for your help. Below code works for extracting a specific tab/worksheet separately and save as xlsx format. But for some reason, one particular tab was extracted and saved and when you open all cells with formulas referencing only cells or calcs have error "#VALUE!" and "#REF!
It's strange because other tabs within the same workbook is fine when extracted but one particular would have the above error in the figures cells. However, when I have the main workbook open and I open this worksheet with error, the figures are fine. Is there another solution to below codes in saving as values? thanks!

Sub Sheet2_XLSXSAVE()
Dim CurrDate As String
CurrDate = Format(Date, "DD.MM.YYYY")
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets("Sheet2").Copy
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & "Sheet2_" & CurrDate & ".xlsx", FileFormat:=51
ActiveWorkbook.Close False
End Sub
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Probably means that the "error" workbook has cell formulas that refer to the original workbook.
 
Upvote 0
In the future, if you post in multiple forums, please let people know that you are doing this and supply the path to the other Post
 
Upvote 0

Forum statistics

Threads
1,225,477
Messages
6,185,218
Members
453,283
Latest member
Shortm88

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