Solved

Excel VBA question

Posted on 2002-03-20
7
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

690 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