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: 2
Default Help create hyperlink from form

Using Excel 2002
I have a user form which has various text boxes which information is typed
into, and then when OK is clicked puts the data from the text boxes in
specific columns on the next emty row of the 'In Work' worksheet.
I would like to have the form add a hyperlink (to an external folder) to one
of the cells, using some predefined (relative) path information, and
extracting the remainder of the path information from the information
entered in the form. This hyperlink would need to follow the data in the
cell around whenever it was sorted, copied, pasted, etc.

The info:
Form uses 'nextmtrow' as the row #, the column for the hyperlink location is
'E'.
The predefined path is 'C:\My Documents\Work\TDP\'
The spreadsheet file lives in 'C:\My Documents\Work' thereby the relativity.
The information extracted from the form data is:
from text box 'NSN' (which is always a 13 digit numerical value): the first
four digits
from text box 'NSN' (which is always a 13 digit numerical value): the first
6 digits with a dash added between digits 4 & 5
from text box 'NSN' (which is always a 13 digit numerical value): the entire
value with a dash added between digits 4 & 5, 6 & 7, 9 &10
from text box 'DrawingNumber': the entire value
from text box 'DashNumber': the entire value

Sample values below:
NSN.value = 1560012251548
DrawingNumber.value = 16D4568
DashNumber.value = -101

Hyperlink full path from above data would look like this: "C:\My
Documents\Work\TDP\1560+\1560-01+\1560-01-225-1548 16D4568 16D4568-101"
the plus sign is a predetermined given, and the breakdown is as follows:
predetermined relative path\first four digits of NSN followed by +\first 6
digits of NSN with dash added between 4th and 5th digit, followed by
+\entire value of NSN with dash added between 4th and 5th, 6th and 7th, and
9th and 10th digits, followed by a space, entire value of DrawingNumber,
followed by a space, entire value of DrawingNumber, entire value of
DashNumber.

The worksheet displays the value of the NSN textbox in the E column (with a
display format which adds the dashes in), having the text turn blue, and
underlined is acceptable but not necessary for my purposes, I have
conditional formatting in place which would overide that aspect (I think).

I primarily need direction in the proper syntax for hyperlink creation, as
well as modification of the NSN value to add the dashes, and spaces have
given me fits before, so maybe that too.

my current primitive state - non-functional code below:

nsnvalue = NSN.Value
drawingnvalue = DrawingNumber.Value
dashnvalue = DashNumber.Value
With Worksheets("In Work").Hyperlinks.Add.Range("E" & nextmtrow), _
"C:\My Documents\Work\TDP\" & nsnvalue & drawingnvalue & drawingnvalue
& dashnvalue
End With


Thanks,

Danny


 
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
User Form to get Hyperlink jlclyde Excel Discussion (Misc queries) 1 December 18th 09 05:13 PM
Hyperlink on a label in a VB Form Gaetan Excel Discussion (Misc queries) 4 May 28th 07 12:35 PM
I am trying to create a form in Excel. In my form I want to be abl AngelaD Excel Discussion (Misc queries) 2 January 5th 07 03:16 PM
How do I create a hyperlink to a cell with the hyperlink function S. Bevins Excel Worksheet Functions 2 July 20th 06 08:06 PM
How to create a form to insert a hyerlink.VBA code to create a for karthi Excel Discussion (Misc queries) 0 July 5th 06 11:26 AM


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