If each worksheet in an Excel workbook contains several charts and now you would like to batch move all charts to a new created worksheet, you can refer to this post. Here we will introduce you 2 easy ways.
After creating charts for the data in each worksheet of an Excel workbook, so as to better analyze data according to these charts, you may want to gather all these charts to a same worksheet. In other words, you may hope to move all of them to a new worksheet. If there are few charts, you can just use the following Method 1 to move one by one. Yet, if there are a myriad of charts, you are better off utilizing the latter one.
Method 1: Manually Move Chart One by One
- At first, create a new worksheet where you want to move all charts.
- Then, open a worksheet and pitch on a chart in it.
- Next, right click on the chart and select “Move Chart” from the context menu.
- In the popup “Move Chart” dialog box, select the new sheet in “Object in” list and click “OK”.
- At once, the selected chart will be moved.
- Now, you can use this way to process all the charts in all worksheets one by one.
Method 2: Batch Move with Excel VBA
- To begin with, launch Excel VBA editor according to “How to Run VBA Code in Your Excel“.
- Then, put the following code into a module or project.
Sub MoveAllCharts() Dim strNewSheet As String Dim objTargetWorksheet As Worksheet Dim objWorksheet As Worksheet Dim objChart As Object 'Create a new sheet strNewSheet = "Charts" ActiveWorkbook.Worksheets.Add(Before:=Application.Worksheets(1)).Name = strNewSheet Set objTargetWorksheet = Application.Worksheets(strNewSheet) For Each objWorksheet In Application.ActiveWorkbook.Worksheets If objWorksheet.Name <> strNewSheet Then 'Move each chart to the new sheet one by one For Each objChart In objWorksheet.ChartObjects objChart.Chart.Location xlLocationAsObject, strNewSheet Next objChart End If Next objTargetWorksheet.Activate End Sub
- Afterwards, directly press “F5” to run this macro right now.
- When macro finishes, exit VBA editor.
- In Excel main window, you can see a new worksheet, in which you can see all the charts.
Comparison
Advantages | Disadvantages | |
Method 1 | Easy to operate | You have to move one by one |
Method 2 | Can process all charts in bulk | Users have to beware of external macros |
Repair Damaged Excel File
Excel file is prone to corruption since Excel can crash now and then. Under such a circumstance, you’d better prepare a powerful and trustworthy xlsx recovery tool, such as DataNumen Excel Repair. It will come in handy when your Excel file gets corrupted and Excel’s auto-recovery feature doesn’t work.
Author Introduction:
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including repair sql and outlook repair software products. For more information visit www.datanumen.com