Cleaning pivot table links and references

  • Thread starter Thread starter Botinha
  • Start date Start date
B

Botinha

Hi!

I have a excel file with a pivot table and i want to distribute this
file without the links to that pivot table. I want to distribute this
file only with the data so that everybody in any part of the world
could read it.
How could i do this with a macro.
Now i copy the sheet to a new one and delete the old sheet. There must
be a better way...
Thanks in advanced

André Fonseca
 
' copy the sheet to a new workbook
Activesheet.Copy
' now remove the pivot table and links
' the activeworkbook/Sheet is the copy of your sheet
Cells.copy
Cells.Pastespecial xlValues
' now save the cleaned up workbook
' avoid warnings if overwriting an existing
' workbook with the same name
Application.DisplayAlerts = False
Activeworkbook.SaveAs "C:\Temp\Nolinks.xls"
Activeworkbook.Close SaveChanges:=False
Application.DisplayAlerts = True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top