selecting cells which are only linked or only cells with for

skalavati

Board Regular
Joined
Apr 16, 2002
Messages
57
Is there an easy way to select all cells in a workbook which are linked is one part of it.

In the same way is there a way to select all cells which contains formulas.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I apologize for jumping the gun, skalavati...
As for your question...
What range of cells are we dealing with?
If it changes, what's the max?
Don't want to wait around for some code to spin through 16,777,216 cells...
Thanks,
Tom
 
Upvote 0
Open the Go To window ( press F5 ) & select "Special". There are quite a few options there, including select all formulas.
 
Upvote 0
This macro will select all cells on a worksheet that's linked.

Sub Select_Linked_Cells()
Dim Linked_Cells() As String
Dim Newrange As Range
On Error Resume Next
Cells.Find(What:=".xls]").Activate
First_Cell = ActiveCell.Address
Do Until Next_Cell = First_Cell
Cells.FindNext(After:=ActiveCell).Activate
Next_Cell = ActiveCell.Address
ReDim Preserve Linked_Cells(x)
Linked_Cells(x) = Next_Cell
x = x + 1
Loop
For x = LBound(Linked_Cells) To UBound(Linked_Cells)
If x = 0 Then
Set Newrange = Range(Linked_Cells(0))
Else
Set Newrange = Application.Union(Newrange, Range(Linked_Cells(x)))
End If
Next
Newrange.Select
End Sub


_________________
It's never too late to learn something new.

Ricky
This message was edited by Ricky Morris on 2002-04-30 09:10
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,150
Members
448,552
Latest member
WORKINGWITHNOLEADER

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