Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find all Hyperlinks present in a sheet
i need a vba code which finds all hyperlinks present in a sheet and
pastes it in a new sheet. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find all Hyperlinks present in a sheet
Sub HyperCopy()
Dim s1 As Worksheet, s2 As Worksheet Dim h As Hyperlink, s As String Set s1 = Sheets("Sheet1") Set s2 = Sheets("Sheet2") For Each h In s1.Hyperlinks s = h.Parent.Address s1.Range(s).Copy s2.Range(s) Next End Sub -- Gary''s Student - gsnu200909 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find all Hyperlinks present in a sheet
Just to follow up on Gary''s Student's method... in case you do not want to
copy the hyperlinks from Sheet1 into the same cells addresses over in Sheet2, but would rather place them adjacent to each other in a column starting from a specified cell (I used cell C3 in my code), then you can do it this way... Sub HyperCopy() Dim s1 As Worksheet, s2 As Worksheet Dim h As Hyperlink, s As String, Index As Long Set s1 = Sheets("Sheet1") Set s2 = Sheets("Sheet2") For Each h In s1.Hyperlinks s1.Range(h.Parent.Address).Copy s2.Range("C3").Offset(Index, 0) Index = Index + 1 Next End Sub And, of course, if necessary, you can go across the row (starting in C3) rather than down the column by changing the Offset property call to Offset(0,Index) instead. -- Rick (MVP - Excel) "Gary''s Student" wrote in message ... Sub HyperCopy() Dim s1 As Worksheet, s2 As Worksheet Dim h As Hyperlink, s As String Set s1 = Sheets("Sheet1") Set s2 = Sheets("Sheet2") For Each h In s1.Hyperlinks s = h.Parent.Address s1.Range(s).Copy s2.Range(s) Next End Sub -- Gary''s Student - gsnu200909 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find all Hyperlinks present in a sheet
thanks a lot
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Locating if a Sheet is present in a workbook | Excel Discussion (Misc queries) | |||
Find any letters present in a range - an example | Excel Programming | |||
Command for present sheet | Excel Programming | |||
testing whether a sheet is present | Excel Programming | |||
finding a value thats present more than once in a sheet | Excel Programming |