Hi guys,
Need some help updating some code (below)
So here is some code that I did ages ago and now I've forgotten it all. Whether its good or crap, what this macro does is...
Based on a push of a button, it selects/copies the specific cell in "Sports", pastes it as a link in "Updates" with the hyperlink target to the same cell in selected in "Sports". This is used in a very large database where the "Updates" sheet is a quick reference summary.
I need help updating what gets outputed. As well as it pasting the copied cell it also needs to include the name of the sheet its from and the date when the button was clicked. for example in a list of sports in the "Sports" sheet, coping the cell with "Football" in it. I need the output in the "updates" sheet to read:
Football - Sports - 01/01/05 (as in the date pressed).
Currently it just outputs "Football".
Sub test_Click()
Range("sport1").Select
Selection.Copy
Sheets("Updates").Select
For x = 1 To 100
If Range("B4:B104").Rows(x).Text = "" Then
Range("B4:B104").Rows(x).Select
x = 100
End If
Next x
ActiveSheet.Paste
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"Sports!sport1"
Sheets("Sports").Select
End Sub
Thanks Chaps
Mathias
Need some help updating some code (below)
So here is some code that I did ages ago and now I've forgotten it all. Whether its good or crap, what this macro does is...
Based on a push of a button, it selects/copies the specific cell in "Sports", pastes it as a link in "Updates" with the hyperlink target to the same cell in selected in "Sports". This is used in a very large database where the "Updates" sheet is a quick reference summary.
I need help updating what gets outputed. As well as it pasting the copied cell it also needs to include the name of the sheet its from and the date when the button was clicked. for example in a list of sports in the "Sports" sheet, coping the cell with "Football" in it. I need the output in the "updates" sheet to read:
Football - Sports - 01/01/05 (as in the date pressed).
Currently it just outputs "Football".
Sub test_Click()
Range("sport1").Select
Selection.Copy
Sheets("Updates").Select
For x = 1 To 100
If Range("B4:B104").Rows(x).Text = "" Then
Range("B4:B104").Rows(x).Select
x = 100
End If
Next x
ActiveSheet.Paste
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"Sports!sport1"
Sheets("Sports").Select
End Sub
Thanks Chaps
Mathias