LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
KS KS is offline
external usenet poster
 
Posts: 33
Default Hyperlinks with Cells(r,c).Value reference

I am trying to update hyperlinks via VBA after I added a hyperlink base to
the excel file properties. I can't figure out why the following code breaks
when I try to assign cellValue for the first time.

====================

Sub SetHyperlinks()

Dim r, c, z As Integer
Dim hyp As Hyperlink
Dim cellValue As Variant

Worksheets("LOG").Select
c = Application.InputBox(prompt:="Enter the column that contains the
hyperlinks to set:")

r = Application.InputBox(prompt:="Enter the row to set to #1:")

z = Application.InputBox("How many hyperlinks to create:")

z = z + r

Do While r <= z
cellValue = ActiveSheet.Cells(r, c).Value ** Object-defined error
here **
If IsNull(cellValue) Then cellValue = " "
ActiveSheet.Hyperlinks.Add Anchor:=ActiveSheet.Cells(r, c),
Address:="Num-" & r & ".pdf", TextToDisplay:=cellValue
r = r + 1
Loop
End Sub

===============

Thanks for any help!
 
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
Relative/Current Cell Reference in Hyperlinks cncf Excel Discussion (Misc queries) 0 June 1st 08 09:46 PM
Cell Reference with Hyperlinks [email protected] Excel Programming 2 December 6th 07 02:42 PM
autocreating hyperlinks in excel? ie 500 cells to 500 hyperlinks? terry Excel Programming 0 November 1st 07 03:55 PM
Formulas that reference cells that reference another cell Andrea Excel Discussion (Misc queries) 7 October 19th 06 08:14 AM
Reference names and hyperlinks to other files in other directories Brains[_2_] Excel Programming 0 February 4th 04 02:01 PM


All times are GMT +1. The time now is 02:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"