Table of contents
- background
- test form
- Steps
-
- Step 1: Select the cells or rows to be exported and click the menu Tools->Macro->Visual Basic Editor
- Step 2: Click the menu Insert->Module in the opened Visual Basic editor
- Step 3: Copy the following code into the module text box just created, as shown in the figure below
- Step 4: Click the blue triangle in the picture above, and click the "Run" button directly in the pop-up window to export the hyperlink of the selected area.
- Notice
background
Recently, I encountered a problem of exporting hyperlinks in batches from a certain column in an excel table. After checking the information and trying it out, I found a simple and feasible method, and now I will share it with you.
test form
The excel table we tested looks like this:
Steps
Step 1: Select the cells or rows to be exported and click the menu Tools->Macro->Visual Basic Editor
Step 2: Click the menu Insert->Module in the opened Visual Basic editor
Step 3: Copy the following code into the module text box just created, as shown in the figure below
Sub ExtractHL()
Dim HL As Hyperlink
For Each HL In ActiveSheet.Hyperlinks
HL.Range.Offset(0, 1).Value = HL.Address
Next
End Sub
Step 4: Click the blue triangle in the picture above, and click the "Run" button directly in the pop-up window to export the hyperlink of the selected area.
Notice
I use excel under a mac system to take demonstration screenshots. If it is a windows system, the menus and operations may be slightly different, but the overall process and code will not change.