Creating a hyperlink from textbox content

Urkrabb

New Member
Joined
Jul 6, 2017
Messages
6
Hi guys,
I have created a userform that sends its content to the active workbook (lets call it workbook A) then sends it to another workbook (Workbook B. What I want to do is to add a hyperlink in Workbook B that refers to Workbook A so that the readers easily can trace their way back. My code looks like this (pardon the Swedish btw)

Sub OmErfarenhet2()
ActiveSheet.Unprotect
RowCount = ActiveSheet.Range("A1").CurrentRegion.Rows.Count
With ActiveSheet.Range("A1")
.Offset(RowCount, 0).Value = Uppföljning.ComboBox2.Value
.Offset(RowCount, 1).Value = Uppföljning.ComboBoxKaraktär.Value
.Offset(RowCount, 2).Value = Uppföljning.ComboNyckeltal.Value
.Offset(RowCount, 3).Value = Uppföljning.ComboBoxTaggar.Value
.Offset(RowCount, 4).Value = Uppföljning.ComboBoxNivå.Value
.Offset(RowCount, 5).Value = Uppföljning.ComboBoxAvdelning.Value
.Offset(RowCount, 6).Value = Uppföljning.TextBox9.Value
.Offset(RowCount, 7).Value = Uppföljning.TextBox1.Value
.Offset(RowCount, 8).Value = Uppföljning.TextBox2.Value
.Offset(RowCount, 9).Value = Uppföljning.TextBox3.Value
.Offset(RowCount, 10).Value = Uppföljning.TextBox4.Value
.Offset(RowCount, 11).Value = Uppföljning.TextBox5.Value
.Offset(RowCount, 12).Value = Uppföljning.TextBox6.Value
.Offset(RowCount, 13).Value = Uppföljning.TextBox7.Value
.Offset(RowCount, 14).Value = Uppföljning.TextBox8.Value
.Offset(RowCount, 15).Value = Date
.Offset(RowCount, 16).Value = Environ("username")
.Offset(RowCount, 17).Value = Uppföljning.ComboBox3.Value

End With

Set lockedrow2 = ActiveSheet.Range(Cells(RowCount + 1, 1), Cells(RowCount + 1, 19))
lockedrow2.EntireRow.Locked = True
ActiveSheet.Protect AllowFiltering:=True
End Sub

Basically I want to add:
.Offset(RowCount, 18).value = hyperlink to Workbook A

The value in combobox3 is the name of the Workbook A, but without .xlsm so i tried using the line:
.Offset(RowCount, 18).Value = "FOLDER ADRESS" & Uppföljning.ComboBox3.Value & ".xlsm"
this gives me the correct link but it is not a hyperlink.

I'm thankfull for all the help i can get, I am however new to this so I might not be able to answer hard follow-up questions.

//Urkrabb
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I forgot to mention that this Sub has been called by another comand that also changes the workbook from workbook A to Workbook B. So when this code runs the active workbook is Workbook B
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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