LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default using VBA to populate a hyperlink field

I have a spreadsheet that contains a column of six-digit numbers, and I
would like to use VBA to create a second column of hyperlinks using the
values in the first column. For example, if the first three records in the
first column consist of the following numbers,

124879
126978
198790

I would like to use VBA to populate the second column where the hyperlink
"Text to Display" would be the six digit number, and the hyperlink "Address"
would be a concatenation of a constant string and that number:

"M:\Projects\" & 124879 & "\"
"M:\Projects\" & 126978 & "\"
"M:\Projects\" & 198790 & "\"

I realize that if I were simply trying to copy a modified version of one
column into another I would use something along the lines of:

For k = 1 to n
Worksheets("Sheet1").Cells(k, 1).Copy
Worksheets("Sheet1").Cells(k, 2).PasteSpecial Paste:=xlValues
Next k

But in this case, I'm trying to create a column of hyperlinks that require
two different values for each cell - the "Text to Display" and the
"Address."

How can I use VBA to create this column of hyperlinks?

Thanks in advance,

Paul


 
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
Populate field automatically TJAC Excel Discussion (Misc queries) 1 January 17th 07 08:02 PM
Populate a field with just workdays Arlen Excel Worksheet Functions 3 January 4th 05 09:05 PM
populate Access numeric field with nothing Dim Excel Programming 2 November 15th 04 06:41 PM
HELP!! Populate text in single XL field, or bulk copy text into 1 field filmfatale[_2_] Excel Programming 0 December 9th 03 02:30 PM
populate concatenate field igor Excel Programming 2 August 13th 03 08:39 PM


All times are GMT +1. The time now is 11:50 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"