PC Review


Reply
Thread Tools Rate Thread

Delete all Links via VBA

 
 
Seanie
Guest
Posts: n/a
 
      21st Jul 2010
How can I delete all links/range names within a range of sheets? I
extract and Copy Paste Special values via below, but it retains links
to the source document (which I don't need)

Thanks

Sourcewb.Sheets(Array("Report1", "Report2", "Report3")).Copy
Set Destwb = ActiveWorkbook

For Each sh In Destwb.Worksheets
sh.Select
With sh.UsedRange
.Cells.Copy
.Cells.PasteSpecial xlPasteValues
.Cells(1).Select
End With
Application.CutCopyMode = False
Destwb.Worksheets(1).Select
Next sh
 
Reply With Quote
 
 
 
 
Kevin Vivian
Guest
Posts: n/a
 
      21st Jul 2010

In article <09ff74fc-d6b6-4ed5-b919-(E-Mail Removed)
s.com>, Seanie <(E-Mail Removed)> writes
>How can I delete all links/range names within a range of sheets? I
>extract and Copy Paste Special values via below, but it retains links
>to the source document (which I don't need)
>
>Thanks
>
> Sourcewb.Sheets(Array("Report1", "Report2", "Report3")).Copy
> Set Destwb = ActiveWorkbook
>
> For Each sh In Destwb.Worksheets
> sh.Select
> With sh.UsedRange
> .Cells.Copy
> .Cells.PasteSpecial xlPasteValues
> .Cells(1).Select
> End With
> Application.CutCopyMode = False
> Destwb.Worksheets(1).Select
> Next sh



Instead of the line -

".Cells.PasteSpecial xlPasteValues"

try this -

..Cells.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False

It worked for me on a similar project.

Cheers

--
Kevin
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Links mvl Microsoft Excel Misc 0 19th Feb 2009 03:13 PM
delete links =?Utf-8?B?UmljaE4=?= Microsoft Excel Crashes 2 9th Feb 2007 02:05 PM
Delete Worksheet and replace/delete links Shaz Microsoft Excel Discussion 3 8th May 2004 12:59 PM
delete from links bar Greg Windows XP Internet Explorer 1 15th Dec 2003 09:16 PM
DELETE LINKS Bob Cort Microsoft Excel Worksheet Functions 2 11th Aug 2003 05:32 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:54 PM.