VBA & Macro Problems

Convert a Column of Web Addresses to Hyperlinks in Excel

John WilsonJohn Wilson Nov 18, 2026 873 views

Question details

Convert plain-text web addresses in selected Excel cells into clickable hyperlinks.

Convert a Column of Web Addresses to Hyperlinks in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains a column of web addresses that the user wants to convert in bulk.
Observed behavior
The URLs are plain text, and the desired result is a clickable hyperlink in each selected cell.
Before you start

Make sure the selected cells contain valid web addresses, preferably including https:// or http://. To use the VBA method, open the workbook in a desktop version of Excel that supports macros.

Solution 1Recommended

Convert Selected URL Cells with an Excel VBA Macro

Use this macro to create hyperlinks directly in the selected cells without adding another column.

1
Open the VBA editor

In desktop Excel, press Alt+F11 on Windows or open the Visual Basic editor from the Developer tab.

2
Insert the macro

In the VBA editor, choose Insert > Module and paste this code: Sub Convert2Hyperlinks() Dim cell As Range Application.ScreenUpdating = False For Each cell In Selection ActiveSheet.Hyperlinks.Add Anchor:=cell, Address:=cell.Value Next cell Application.ScreenUpdating = True End Sub

3
Select the URL cells

Return to the worksheet and select only the cells containing the web addresses you want to convert.

4
Run the macro

Open Developer > Macros, select Convert2Hyperlinks, and click Run. Click a converted cell to check its destination.

Convert Selected URL Cells with an Excel VBA Macro
Keep the macro if needed: To retain the VBA code in the workbook, use File > Save As and choose Excel Macro-Enabled Workbook (.xlsm). Enable macros only when you trust the workbook.
Work with URLs in WPS Spreadsheet

Create Clickable URL Links in WPS Spreadsheet

Use the HYPERLINK function in WPS Spreadsheet to turn a column of plain-text addresses into clickable links in a separate column.

  1. 1. Open the workbook: Open WPS Spreadsheet and use Open to select the workbook containing your URL column.
  2. 2. Enter the link formula: If the first address is in A2, click an empty cell such as B2 and enter =HYPERLINK(A2,A2).
  3. 3. Fill down: Drag the fill handle from B2 down beside the rest of the URL list.
  4. 4. Test and save: Click a generated link to check it, then use File > Save to save the workbook.
Create links for a list of URLs without a macroOpen and edit Microsoft Excel XLSX filesFill a formula down a column to process multiple addressesUse a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Can I convert the URLs in place without adding a column?

Yes. In desktop Excel, select the URL cells and run the Convert2Hyperlinks VBA macro to add a hyperlink to each selected cell.

Can I run the VBA macro in Excel for the web?

Excel for the web cannot run VBA macros. Open the workbook in desktop Excel to run the macro, or use a HYPERLINK formula in a separate column.

Why does a generated hyperlink not open the expected page?

Check the source cell for a complete, valid address, including https:// or http:// where appropriate. Correct the address and test the link again.

How do I keep the VBA macro in my workbook?

In Excel, choose File > Save As and select Excel Macro-Enabled Workbook (.xlsm). A standard .xlsx file cannot retain VBA code.