Hi All
Want to thank the help i got earlier. Its muchly appreciated
Just one more :P
Is it possible to copy a whole row of data to a different sheet on the next free line in that sheet?
i hope this makes sense
Thanks in advance
Crampz
Printable View
Hi All
Want to thank the help i got earlier. Its muchly appreciated
Just one more :P
Is it possible to copy a whole row of data to a different sheet on the next free line in that sheet?
i hope this makes sense
Thanks in advance
Crampz
Is it again related to hyperlink or a general question?
Like this?
Code:Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim lRow As Long
If Range(Target.Range.Address).Column = 2 Then
lRow = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
Target.Range.EntireRow.Copy Sheets("Sheet2").Rows(lRow)
End If
End Sub
Just replace the code with this code in the sample that I uploaded in your previous workbook. :)
or thisCode:Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim lRow As Long
If Range(Target.Range.Address).Column = 2 Then
lRow = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
Target.Range.EntireRow.Copy
Sheets("Sheet2").Rows(lRow).PasteSpecial xlValues
End If
End Sub
Code:Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim lRow As Long
If Range(Target.Range.Address).Column = 2 Then
If Application.WorksheetFunction.CountA(Sheets("Sheet2").Columns(1)) = 0 Then
lRow = 1
Else
lRow = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
End If
Target.Range.EntireRow.Copy
Sheets("Sheet2").Rows(lRow).PasteSpecial xlValues
End If
End Sub
You are welcome :)