Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default macro for making hyperlinks

Hi all,

Im my workbook in sheet 1 I have 100 names in A2:A101.
I want to make each name a hyperlink that leads to the cell with the
corresponding rownumber in column BB of sheet 2.
So clicking the name/hyperlink in A8 of sheet 1 leads to BB8 in sheet 2.
I can't figure out the code.
Your assistance will be appreciated.

Jack Sons
The Netherlands


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default macro for making hyperlinks

Sub hyperlink()
For i = 2 To 100
Sheet1.Cells(i, 1).Activate
Name = Cells(i, 1)
SubAddress = "Sheet2!BB" & i
If Cells(i, 1) < "" Then
ActiveSheet.Hyperlinks.Add Anchor:=Cells(i, 1), Address:="",
SubAddress:=SubAddress, TextToDisplay:=Name
End If
Next
End Sub

Press Alt+F11 and copy paste the above and try running the macro.


"Jack Sons" wrote:

Hi all,

Im my workbook in sheet 1 I have 100 names in A2:A101.
I want to make each name a hyperlink that leads to the cell with the
corresponding rownumber in column BB of sheet 2.
So clicking the name/hyperlink in A8 of sheet 1 leads to BB8 in sheet 2.
I can't figure out the code.
Your assistance will be appreciated.

Jack Sons
The Netherlands



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default macro for making hyperlinks

I recorded a macro that creates such link and I simply add a loop around.
Here is the result:

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 02-08-2007 by SQ
'

For i = 1 To 65536
If Cells(i, "A").Value < "" Then
Cells(i, "A").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, _
Address:="", SubAddress:= _
"Sheet2!BB" & i, TextToDisplay:=Cells(i, "A").Value
End If
Next i

End Sub


Jack Sons wrote:
Hi all,

Im my workbook in sheet 1 I have 100 names in A2:A101.
I want to make each name a hyperlink that leads to the cell with the
corresponding rownumber in column BB of sheet 2.
So clicking the name/hyperlink in A8 of sheet 1 leads to BB8 in sheet 2.
I can't figure out the code.
Your assistance will be appreciated.

Jack Sons
The Netherlands


--
Message posted via http://www.officekb.com

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
Making macro George A. Jululian Excel Discussion (Misc queries) 7 July 21st 07 04:09 PM
Making a macro always available simonc Excel Discussion (Misc queries) 1 April 19th 07 09:30 AM
help on macro for making chart roger Charts and Charting in Excel 3 April 2nd 07 04:43 PM
How can I stop excel from automatically making hyperlinks MAB5025 Excel Discussion (Misc queries) 5 May 23rd 06 03:53 AM
Making Hyperlinks Active In Entire Column JXD New Users to Excel 2 January 18th 06 11:28 PM


All times are GMT +1. The time now is 10:19 PM.

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"