copy/paste in VBA

waldymar

Board Regular
Joined
Feb 19, 2009
Messages
238
Dear All,

I have developed a macro which copy my report and paste it as values to a new worksheet. The problem is that the report has a couple of graphs which are not copied as values and keep links to the original source. How to solve this issue and paste my graphs as values as well?
This is the code:
Code:
Sub Moving()
Application.ScreenUpdating = False
Dim varPath As String
Dim WbOpen As Workbook
Set WbOpen = Workbooks.Add
varPath = coding.Range("b1").Value
currdashboard.Copy before:=WbOpen.Sheets(1)
      
Application.DisplayAlerts = False
WbOpen.SaveAs varPath & "\Currency and Interest Rate Dashboard-" & Format(Date, "dd-mmm-yyyy") & ".xlsx"
Application.DisplayAlerts = True
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
WbOpen.Close savechanges:=True
Application.ScreenUpdating = True
End Sub

Thanks in advance
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Something like this?
To copy graph:
Code:
Sub Macro1()

    ActiveSheet.ChartObjects("Grafico 1").Activate
    ActiveChart.ChartArea.Copy
    Sheets("Foglio2").Select
    ActiveSheet.Paste
End Sub

To move graph:
Code:
Sub Macro2()

    ActiveSheet.ChartObjects("Grafico 1").Activate
    ActiveChart.Location Where:=xlLocationAsObject, Name:="Foglio3"
   
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,719
Members
452,939
Latest member
WCrawford

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