What isn't working?What does your code look like?
I put random numbers in 100,000 cells in Book1.xlsbThen, in Book2, I put
100,000 cells with links to the corresponding cell in Book1.
I then created a macro module with:Option ExplicitSub RemoveLinks()
Dim aLinks, inx
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
End Sub
Ran RemoveLinks and it replaced all 100,000 cells with the contents immediately.
what does your code look like, and what do you mean that it "the code is not
working"?
Is it not removing the links?is it giving you an error?
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 Wednesday, May 24, 2017 1:42 AM, KAUSHIK SAVLA <[email protected]>
wrote:
Hi Paul,
The code is not working.
Can you please provide full code starting with Sub...till End sub
Regards,kaushik Savla
On Wed, May 24, 2017 at 12:42 AM, Paul Schreiner <[email protected]> wrote:
If you also want to get rid of the "internal" links and formulas, you can make
use of the fact that, for a given cell, the VALUE of the cell is what is
displayed, while the FORMULA of the cell is just that, the formula.
For cells with a simple value, like "3", then the formula and value are nearly
the same.(the issue is that the value would be an integer, but the formula
would be a string "3")
So, basically you could compare the value and formula for each used cell and
overwrite if they are different.
I "convert" both the Value and Formula to strings to ensure they are compared
properly, and use:
Sub BreakLinks()
Dim Rng As Range
For Each Rng In Sheets(1).UsedRange
If (Rng.Formula & "X" <> Rng.Value & "X") Then Rng.Formula = Rng.Value
Next Rng
End Sub
I created a sheet with 1000 rows and 100 columns. (so 100,000 cell contents)I
then created a sheet that had 100,000 cells that added the contents of the
adjacent sheet.
This macro converted the 100,000 cells to values in about 3 seconds.
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:56 PM, KAUSHIK SAVLA <[email protected]>
wrote:
This is think will definitely help.
Thanks.
On May 24, 2017 00:23, "Paul Schreiner" <[email protected]> wrote:
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 excel-macros+unsubscribe@ googlegroups.com.
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 a topic in the Google
Groups "MS EXCEL AND VBA MACROS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/excel-macros/- AQpNB48JzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
excel-macros+unsubscribe@ googlegroups.com.
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 excel-macros+unsubscribe@ googlegroups.com.
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 a topic in the Google
Groups "MS EXCEL AND VBA MACROS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/excel-macros/- AQpNB48JzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
excel-macros+unsubscribe@ googlegroups.com.
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.
--
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.