2012-07-18, 15:09 #1
- Join Date
- Jan 2009
- Thanked 0 Times in 0 Posts
copying and pasting a hyperlink in VBA Excel 2003
Need some help tweaking the VBA. This code works fine other than I am copying a hyperlink in line "Cells(2, 3).Value = Cells(rw, 7).Value"
While it copies the text fine, it doesn't copy the hyperlink. Is there a way to copy the hyperlink?
Dim shInv As Worksheet
Set shInv = ThisWorkbook.Sheets("Cover Letter")
If Selection.Column <> 6 Or Selection.Value = "" Then
MsgBox "There is nothing to export!" & Chr(10) & "Select a cell with data from column F," & Chr(10) & "and try again"
rw = Selection.Row
.Cells(2, 3).Value = Cells(rw, 7).Value
.Cells(3, 3).Value = Cells(rw, 9).Value
.Cells(3, 10).Value = Cells(rw, 8).Value
.Cells(4, 3).Value = Cells(rw, 10).Value
.Cells(4, 9).Value = Cells(rw, 15)
Subscribe to our Windows Secrets Newsletter - It's Free!
Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!
+ Get this BONUS — free!
Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!
2012-07-19, 07:56 #2
- Join Date
- Dec 2000
- Burwash, East Sussex, United Kingdom
- Thanked 79 Times in 75 Posts
Perhaps change it to:
Cells(rw, 7).Copy Destination:=.Cells(2, 3)Regards,
Microsoft MVP - Excel.