Hello All,
I currently have a spreadsheet that is linking to a lot of data. I have written a partial macro to copy the worksheet and paste just the values (removing linkages).
I think currently have 4 charts that I would like to copy and paste as images which would remove the links to those as well... but my macro doesn't seem to be working as such.
current code:
Macro_Start & Macro_End both are just turning on and off calculation... updating... etc.
Ask: How would i make this scalable to be able to look at X number of charts - copy them, delete them, then paste the picture of the chart.
Reason: This is a roll-up for some executives that I have to do every friday and it gets pulled into another report.
- Matt
"If I must boast, I will boast of the things that show my weakness"
- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
I currently have a spreadsheet that is linking to a lot of data. I have written a partial macro to copy the worksheet and paste just the values (removing linkages).
I think currently have 4 charts that I would like to copy and paste as images which would remove the links to those as well... but my macro doesn't seem to be working as such.
current code:
Code:
Sub Create_Summary()
Macro_Start
'Copy and Paste values on Milestone Dashboard Page
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Copy and Paste Charts as Images (removing Links)
Application.CutCopyMode = False
ActiveSheet.ChartObjects("Chart 7").Activate
ActiveChart.Paste
ActiveSheet.ChartObjects("Chart 8").Activate
ActiveChart.Paste
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Paste
ActiveSheet.ChartObjects("Chart 2").Activate
ActiveChart.Paste
'Hide the tabs we don't need
For x = 1 To Sheets.Count
If Sheets(x).Name <> "Milestone Dashboard" _
And Sheets(x).Name <> "Milestones Data" _
And Sheets(x).Name <> "CR Dashboard" Then
Sheets(x).Delete
End If
Next x
Sheets("Milestone Dashboard").Select
'Save the Spreadsheet as the current location and add "SUMMARY - " to the beginning
ActiveWorkbook.SaveAs ActiveWorkbook.Path & "\SUMMARY - " & ActiveWorkbook.Name
Macro_End
End Sub
Macro_Start & Macro_End both are just turning on and off calculation... updating... etc.
Ask: How would i make this scalable to be able to look at X number of charts - copy them, delete them, then paste the picture of the chart.
Reason: This is a roll-up for some executives that I have to do every friday and it gets pulled into another report.
- Matt
"If I must boast, I will boast of the things that show my weakness"
- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008