Submit text box value to sheet, then hyperlink that value to a file.

DWRgt2885

New Member
Joined
Nov 20, 2017
Messages
25
Hi Everyone!

I have a workbook i created as an order management system at work. The user form passes data to the sheet. Each PO # has it's own row. I also save a PDF copy of each PO to a folder on my PC. This is a section of my "submit" button code "txtSSPO" is the text box where the PO # is entered. When I submit the user form data, i'd like the PO value (on sheet) to be a hyperlink to the PDF file on my PC. the file names are the PO numbers. and they are all stored in the same folder.


Code:
 ' Write data to worksheet
       
        rowCount = Worksheets("Order Status").Cells(Worksheets("Order Status").Rows.Count, 1).End(xlUp).Row
        With Worksheets("Order Status").Range("A1")
    
          .Offset(rowCount, 0).Value = Date
          .Offset(rowCount, 1).Value = Me.txtvendor.Value
          .Offset(rowCount, 2).Value = Me.txtcust.Value
          .Offset(rowCount, 3).Value = Me.txtSSPO.Value[FONT=Menlo, Monaco, Consolas, Courier New, monospace][COLOR=#000000] '[/COLOR][/FONT][COLOR=#000000][FONT=Menlo].Hyperlinks.Add Anchor:= ????[/FONT][/COLOR][COLOR=#000000][FONT=Menlo], _ [/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]' Address:=[/FONT][/COLOR][COLOR=#A31515][FONT=Menlo]"C:\Users\ME\Desktop\Hub Folder\05-12345-1.pdf"[/FONT][/COLOR][COLOR=#000000][FONT=Menlo], _ [/FONT][/COLOR]      
 
          End With

I think I'm close, but it's making me cookoo....Can someone explain what i'm doing wrong here? Thank you for any input you may have to offer!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top