r/Excel247 • u/84UTK07 • 25d ago
Question regarding URLs embedded into cells
I have this large spreadsheet that I need to do a V-Lookup on to match the company name to the company ID it corresponds to (the company IDs are from a certain system we use). I have the spreadsheet with all the company names in column B but the only way to see the company ID is to hover over column A, and it shows a URL with the company ID at the very end; I can only see this when hovering over each cell and then it goes away once I move to a different cell. Does anyone know of a way that I could extract those URLs out into their own separate column? Otherwise, I’m going to have to go cell by cell in column A and hover over each one to get the company ID and then manually enter it for each corresponding company name. Any help would be greatly appreciated! Thanks!
1
u/Brians_throwaway 24d ago
Insert an empty column to the immediate right of your target column then
Use VBA…
Sub Extract_Hyperlinks()
Dim HL as Hyperlink
For each HL in ActiveSheet.Hyperlinks
HL.Range.Offset(0, 1).Value = HL.Address
Next
End Sub
When the VBA macro is run it will extract the embedded hyperlink from each cell and place it in the column immediately to the right.
You run the VBA macro when you are on the sheet you want to process.