[ This Message was edited by: TsTom on 2002-04-29 23:29 ]
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.
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
Open the Go To window ( press F5 ) & select "Special". There are quite a few options there, including select all formulas.
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 ]
Like this thread? Share it with others