Moving worksheet with charts to new workbook - VBA

kalcerro_1

New Member
Joined
Feb 28, 2020
Messages
27
Office Version
  1. 365
Platform
  1. Windows
Hello All,
I have this workbook, which is a xlsm, I will call it "A"
There is a sheet in this that summarize in 6 charts all the information of the WB "A". 6 charts are being populated by another sheet where all formulas are stored.
I'm trying to move this worksheet to a new workbook "B" (where all chart worksheets will be stored), and it works good, but when I close the new workbook "B", and re-open it again, excel asks me to update the link to the data, I do Update but just 3 charts are present. All 6 charts have the same sheet where data is stored to populate them.
I want to know if it's possible to move the chart without the data source to populate them.

This is the simple code I'm using now:

VBA Code:
Private Sub CommandButton1_Click()
 
 Dim FileToImport As Variant
    FileToImport = Application.GetOpenFilename(FileFilter:="XLSM's  (*.xlsm), *.xlsm", Title:="Select Partner Result to import")
        If FileToImport = False Then Exit Sub
    MsgBox "This process will take a few seconds, please wait", vbOKOnly

Workbooks.Open FileToImport

Sheets("6.Results").Select
Sheets("6.Results").Copy after:=ThisWorkbook.Sheets(1)
Sheets("6.Results").Select
Sheets("6.Results").Name = ActiveSheet.Range("b4")

End Sub
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,214,923
Messages
6,122,283
Members
449,075
Latest member
staticfluids

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