VBA to format font color in a hyperlinked cell if selected

Tmoske

Board Regular
Joined
Jan 14, 2009
Messages
145
Good afternoon,
I need help with a simple macro to change the font color in a hyperlinked cell after it has been selected. This way the cell would indicate that it has already been selected. I have many sheets with hyperlinks and would like it to only work on "Sheet 1" for example.

Thanks so much,
Tmoske
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi Tmoske,

The default behavior is for the font to change - is that not happening for you on Sheet1?
... or is your challenge to not change the font color of followed hyperlinks on the other sheets?

The cell format of a hyperlinks before and after being clicked can be controlled by Cell Styles.
For xl2007 and later go the Ribbon > Styles group > Cell Styles
Right-click on Followed Hyperlink > Modify... > then change that styles appearance properties to what you want.

If you are only trying to reset that default behavior, you shouldn't require VBA to do that.
 
Upvote 0
I had no idea it was going to be that simple. This does the trick very well. Thank you for your help.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top