Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not getting the desired result with this loop:
A1 = hello A2 = goodbye A3 = hello again when I run this macro with cells A1-A2 selected, the resulting hyperlink is http://www.google.com/search?&q=goodbye for all selected cells. When I run the macro with A3 selected, it breaks with an error. 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= & Chr(34) & Cell.Value & Chr(34) ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=sLinkAddress Exit For End If Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
returning back to loop check condition without completing the loop | Excel Programming | |||
Loop to Filter, Name Sheets. If Blank, Exit Loop | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming |