修正了我自己排序:)
I=3,共计 细胞(I,11) =细胞(I,1).Hyperlinks.Item(1).Address细胞(I,12) =细胞(I,2).Hyperlinks.Item(1).Address Next I
我从来没有在excel中做过任何脚本,所以任何帮助都值得赞赏。
我想从列1& 2中提取超链接地址(URL),并将它们粘贴到另一列(所以我可以导出带有链接的CSV )。
我想做这样的事情在一个循环,但它不工作!
ActiveSheet.Cells(i, 11).Value = ActiveSheet.Cells(i, 1).Hyperlinks.Item(1).Address
ActiveSheet.Cells(i, 12).Value = ActiveSheet.Cells(i, 2).Hyperlinks.Item(1).Address谢谢!
发布于 2012-11-13 16:18:15
下面是一个示例,说明如何获取工作表前两列中的所有超链接,并将它们写入下一个工作表。
Sub getHyperlinks()
'used to keep track of where we are at when writing to the second sheet
Dim iWriteRow As Long
'used to hold how many columns to look through
Dim numberOfCols As Long
numberOfCols = 2
'set initial position
iWriteRow = 1
'variable used in looping through the hyperlinks
Dim h As Hyperlink
'loop through all hyper links on the sheet
For i = 1 To numberOfCols
For Each h In ActiveWorkbook.Sheets(1).Columns(i).Hyperlinks
'write them to the next sheet
ActiveWorkbook.Sheets(2).Cells(iWriteRow, i).Value = h.Address
'add 1 to our counter
iWriteRow = iWriteRow + 1
Next
iWriteRow = 1
Next i
End Subhttps://stackoverflow.com/questions/13363690
复制相似问题