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
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