You are on page 1of 11

EXCEL AUTOMATION

WITH CHATGPT
Creating a Hyperlinked
Index Sheet

RICHARD NERO
WHEN YOU CREATE A LARGE
WORKBOOK NAVIGATION CAN
BE FIDDLY

Ensure users can hop


around your files easily with
this ChatGPT fueled hack

RICHARD NERO
THE PROMPT

RICHARD NERO

Write me a VBA macro that will create a new sheet


called Index. If it already exists check with the user
that it is ok to carry on and clear all from the Index
sheet before continuing.

Loop through all sheets in the workbook and add a


hyperlink to each sheet in the Index sheet in
column C.

Make column B 20 pixels wide and then highlight


that cell the same colour as the corresponding
sheet with white borders.

RICHARD NERO
THE RESPONSE

CHATGPT

RICHARD NERO
WHAT DO YOU DO WITH ALL
THAT LOVELY VBA CODE?

Hit ‘Copy code’ in ChatGPT

Go into Excel and press the


shortcut Alt + F11

This takes you into VBA world

RICHARD NERO
Now click in sequence
Alt + I + M

This will insert a new VBA


module for you

Now Ctrl+V that code into


the module

Paste it here

RICHARD NERO
Now you just need to run
the macro

Hit Alt+F8 to bring up the


Macro window

Click ‘Run’

RICHARD NERO
Beautifully formatted
hyperlinks!!

Check out that colour


coordination

RICHARD NERO
If I run the macro again..

..that sweet error


handling kicks in

RICHARD NERO
You have just saved
yourself about 30mins

You deserve a pay rise, a


promotion or perhaps both

RICHARD NERO
If you enjoyed that please repost
so your network can enjoy it too

Follow for more Excel +


ChatGPT automation tips

Richard Nero
Finance Systems Consultant |
Excel Trainer | Mentor | SQL |
Python | Power Platform Pro

Let me know your


thoughts in the
comments

You might also like