?
Solved

Excel VBA question

Posted on 2002-03-20
7
Medium Priority
?
165 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
Independent Software Vendors: 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 400 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

764 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