That's very CPU intensive because it copies all cells to the clipboardand
pastes them from clipboard.which can be a HUGE number of cells for each sheet.
If you simply want to break the external links, you can use something like:
alinks = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(alinks) Then
For inx = 1 To UBound(alinks)
ActiveWorkbook.BreakLink _
Name:=alinks(inx), _
Type:=xlLinkTypeExcelLinks
Next inx
End If
This will break links to EXTERNAL workbooks (and convert to values) but it
doesn't do anything to the links to worksheets within the current workbook.
does that help? Paul-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------
On Tuesday, May 23, 2017 2:03 PM, KAUSHIK SAVLA <[email protected]>
wrote:
Hi Team,
I am trying to do below in an excel. You can assume there are 60 worksheets
minimum in a workbook.
1. In opened excel file. Which has links from several files2. All cells of the
workbook I am doing paste special values3. Then to come at the first cell in
all worksheets (i.e. Cell A1)4. Then to come at first tab, first cell, Save the
workbook here (so whenever excel opens the person will see first sheet, first
cell)5. Close the workbook
I am having below vba code. It is taking forever to run (minimum 15-20
minutes). Can anyone please help in boosting speed so could be run in fraction
of seconds.
Sub Select_All_Sheets()Dim sht As WorksheetDim SelectMe() As StringDim s As
IntegerFor Each sht In Worksheetss = s + 1ReDim Preserve SelectMe(1 To s) As
StringSelectMe(s) = sht.NameSheets(SelectMe).SelectCells.Select
Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False
Application.CutCopyMode = False Application.Goto
Range(Cells(ActiveWindow.SplitRow + 1, ActiveWindow.SplitColumn + 1).Address)
ActiveWorkbook.SaveNextEnd Sub
Regards,Kaushik Savla--
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
https://www.facebook.com/discussexcel
FORUM RULES
1) Use concise, accurate thread titles. Poor thread titles, like Please Help,
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.
NOTE : Don't ever post confidential data in a workbook. Forum owners and
members are not responsible for any loss.
---
You received this message because you are subscribed to the Google Groups "MS
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.
--
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
https://www.facebook.com/discussexcel
FORUM RULES
1) Use concise, accurate thread titles. Poor thread titles, like Please Help,
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.
NOTE : Don't ever post confidential data in a workbook. Forum owners and
members are not responsible for any loss.
---
You received this message because you are subscribed to the Google Groups "MS
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.