Updated date:

Create a Button in Excel to Follow a Hyperlink

Joshua is a graduate student at the USF. He has interests in business technology, analytics, finance, and lean six sigma.

create-a-button-in-excel-to-follow-a-hyperlink

Creating a button that will take you to a web page can be a very useful tool. If you periodically go to the same web page while working in a workbook, it may make sense just to create a button to get you to that web site.

Find the Developer Tab

First, click on the developer tab. If you don't have the developer tab in your Excel ribbon, you can figure out how to add it here.

The developer tab opens a spreadsheet to wide range of options. One option that is needed here is that of a button.

The developer tab opens a spreadsheet to wide range of options. One option that is needed here is that of a button.

Insert a Button

Next, click on the insert a "command button." This is located in the upper left-hand corner of the active x control section. After the button is selected, drag the cursor with the left mouse button help to trace a square or rectangle. This will dictate how large your button will appear.

Command Button Selection

create-a-button-in-excel-to-follow-a-hyperlink

Find Button Properties

Right click on the button and select properties.

Properties

create-a-button-in-excel-to-follow-a-hyperlink

Edit Caption

Type what you want to display on the button in the caption section. Then, close out the properties window.

create-a-button-in-excel-to-follow-a-hyperlink

Add Code to the Button

Double click on the button so that the visual basic window appears and type the following information in that window with no spaces between lines:

Private Sub CommandButton1_Click()
ActiveWorkbook.FollowHyperlink _
Address:="https://www.roghnu.com
End Sub

Note that “CommandButton1” is the name of the object and may be different for you depending on what you name your button. Additionally, you will want to choose the website that you would like to open in the place of http://www.roghnu.com. Click on the save button and save your workbook as a macro enabled workbook. Exit the visual basic window.

Visual Basis Application

create-a-button-in-excel-to-follow-a-hyperlink

Get out of Design Mode

Lastly, save the Excel file and exit the design mode by selecting the design button in the controls section. Each time your button is selected your web browser should automatically open to display the web address that was saved in the button properties.

create-a-button-in-excel-to-follow-a-hyperlink

This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.

© 2019 Joshua Crowder

Comments

RJ on August 22, 2020:

i follow the Instruction, but nothing happens