Solved

Excel VBA question

Posted on 2002-03-20
7
159 Views
Last Modified: 2012-05-04
Ok.  I have a column full of hyperlinks in Excel.

I need to find out how to seperate the 'text' from the 'link'

Please help!!!
0
Comment
Question by:AAMFK
7 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 6883837
don't really understand:

    Dim url As String
   
    url = Sheet1.Cells(1, 1) '' this is a hyperlink
    MsgBox url

all i get is text what do you mean by the 'link'
0
 
LVL 4

Expert Comment

by:wileecoy
ID: 6883851


Ok - try this - this is with the 'Selection'.  You can also use it with the 'Worksheet'.


Dim h As Hyperlink

For Each h In Selection.Hyperlinks
    MsgBox h.Name
    MsgBox h.Address
Next


HTH,

Wileecoy.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6883854
Hearing for further details...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 44

Accepted Solution

by:
bruintje earned 100 total points
ID: 6884092
Hey thanks Wileecoy, that's what i was after ;) i used it with the worksheet object but didn't look for a narrower thing with the selection you can use it in a range and do something like

i=1
Range("A1:A20000").select
For Each h In Selection.Hyperlinks
   Range("B" & i).value= h.Name
   Range("C" & i).value= h.Address
   i=i+1
Next

going through the worksheet took to much time with 16000 hyperlinks and only half of them relevant

:O)Bruintje

PS not meant as comment to this question
0
 
LVL 4

Expert Comment

by:wileecoy
ID: 6885734
Any progress AAMFK?
0
 
LVL 1

Author Comment

by:AAMFK
ID: 7207890
uh i ended up saving it as a HTML and parsing--

but ill award these points thanks
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7210856
wileecoy, since an accepted answer can't be reversed i'll post a seperate Q for you here

http://www.experts-exchange.com/visualbasic/Q_20334794.html

:O)Bruintje
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA loop through headers using value 3 57
A macro to Count the number of rows across all worksheets 3 81
Excel - Save a copy of work book 13 83
TT Auto Dashboard 13 83
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now