Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default How to obtain Cell Address and/or Select all sheet-cells with xlExcelLinks

2003, 2007


With the code below as a base point: Is there a way to obtain

1) Obtain the address of and/or
2) Select all cells with links?

Sub OpenAllLinks()
Dim arLinks As Variant
Dim intIndex As Integer
arLinks = ActiveWorkbook.LinkSources(xlExcelLinks)

If Not IsEmpty(arLinks) Then
For intIndex = LBound(arLinks) To UBound(arLinks)
ActiveWorkbook.OpenLinks arLinks(intIndex)
Next intIndex
Else
MsgBox "The active workbook contains no external links."
End If

End Sub


TIA EagleOne
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default How to obtain Cell Address and/or Select all sheet-cells with xlEx

I'd try something like this:

Option Explicit

Sub TestLinks()
Dim myHyperlink As Excel.Hyperlink
Dim myRange As Excel.Range

Set myRange = Nothing

Debug.print ActiveSheet.Hyperlinks.Count

For Each myHyperlink In ActiveSheet.Hyperlinks
Debug.Print myHyperlink.Parent.Address
If myRange Is Nothing Then
Set myRange = myHyperlink.Parent
Else
Set myRange = Union(myRange, myHyperlink.Parent)
End If
Next myHyperlink

If Not myRange Is Nothing Then
myRange.Select
End If


End Sub


" wrote:

2003, 2007


With the code below as a base point: Is there a way to obtain

1) Obtain the address of and/or
2) Select all cells with links?

Sub OpenAllLinks()
Dim arLinks As Variant
Dim intIndex As Integer
arLinks = ActiveWorkbook.LinkSources(xlExcelLinks)

If Not IsEmpty(arLinks) Then
For intIndex = LBound(arLinks) To UBound(arLinks)
ActiveWorkbook.OpenLinks arLinks(intIndex)
Next intIndex
Else
MsgBox "The active workbook contains no external links."
End If

End Sub


TIA EagleOne

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: IF FALSE in 2 Cells, Then Obtain Value From 3rd Cell? badgereurex Excel Programming 1 May 7th 08 03:36 PM
Find Blank Cells and List Each Cell Address in Another Sheet ryguy7272 Excel Programming 4 August 13th 07 04:24 PM
How to obtain cell address of a succesful VLookup? [email protected] Excel Programming 8 June 27th 07 06:25 PM
How do I obtain the address of a cell using the vlookup function? Spock Excel Worksheet Functions 2 May 16th 05 06:35 PM
Would like to Obtain a Cell Address from a vlookup function CR_2004_04_08 Excel Programming 3 April 9th 04 11:12 AM


All times are GMT +1. The time now is 08:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"