Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default hyperlink creation problem

I'm new and I'm experiencing a few problems. Here is the code:

Sub makelink()
Dim Cell As Range
For Each Cell In Intersect(Selection, ActiveSheet.UsedRange)
If Cell < "" Then
Dim sLinkAddress As String
sLinkAddress = "http://www.google.com/search?&q=" & Cell.Value
ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:=sLinkAddress
End If
Next
End Sub

Problem 1 is that if I select multiple cells, the Cell.Value of the
last cell is used for all of them.
Problem 2 is that if Cell.Value contains a space, it breaks with an
error 400. (maybe the code should convert spaces to plus sign)
Problem 3 is that i need Cell.Value in quotes and adding & Chr(34)
before and after Cell.Value doesnt work.

I know about the hyperlink function but I want a macro so I can store
the search string and call it easily.

Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default hyperlink creation problem

Update: Solved problem 3
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
Hyperlink creation problem [email protected] Excel Programming 2 October 19th 07 10:01 PM
Hyperlink creation problem [email protected] Excel Programming 0 October 17th 07 07:14 PM
Automating hyperlink creation Steve Williams Excel Worksheet Functions 1 October 14th 05 01:50 AM
entering emails without hyperlink creation Jim Sullivan Excel Discussion (Misc queries) 6 September 25th 05 03:47 PM
Hyperlink Creation in Excel X for Mac MNMBerk Excel Worksheet Functions 1 December 15th 04 06:50 PM


All times are GMT +1. The time now is 12:33 AM.

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"