Unable to change link font (keeps changing back to default)

Ironman

Well-known Member
Joined
Jan 31, 2004
Messages
1,069
Office Version
  1. 365
Platform
  1. Windows
Hi

Cell B1 contains a link with the word ACTIVITY. I change the font to Segoe UI size 9 and it works fine until I next open the workbook, when it reverts to the default Comic Sans MS and it's driving me nuts.

I recently changed the default hyperlink font to Comic Sans MS in the Excel Styles toolbar, which I guess is what's causing the problem but I still want all other current and future links to be in Comic Sans MS font.

Help appreciated!

Many thanks
 
Is that the proper name of the Style ??
It look more like a font name ?
If you created a new style using an existing font name I think it would fail.
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Ahh, I didn't know about that, thanks Michael, that's something else I've learnt from you.

I named and applied the new style IronMan to that cell, which worked fine...until I reopened the workbook, when I saw it change back to Comic Sans MS right in front of my eyes during the open event. I just can't see what's happening in the open event that could be causing that to happen.
 
Upvote 0
In that case I'm guessing the Hyperlink style will take precendence over any other , if the cell is actually a hyperlink cell
AND
The cells style doesn't seem that much different ??
 
Upvote 0
This is what's happening with that cell and thanks to your train of thought, I've just located the error!
VBA Code:
Private Sub Workbook_SheetChange(ByVal sh As Object, ByVal target As Range)
 ' The following creates a link in Training Log B1 back to the last amended cell in the workbook

    Dim ws As Worksheet
    Set ws = Worksheets("Training Log")
   
    ws.Hyperlinks.Add Anchor:=ws.Range("B1"), Address:="", SubAddress:= _
          "'" & sh.Name & "'" & "!" & target.Address(0, 0), ScreenTip:="Go to last active cell", TextToDisplay:="ACTIVITY"
    With ws.Range("B1")
.Font.FontStyle = "Segoe UI"
.Font.Size = 9
.Font.Bold = True
End With
End Sub
I changed .Font.FontStyle = "Segoe UI" to .Font.Name = "Segoe UI" and it works fine now.

Thanks a lot Michael!
 
Upvote 0
Solution
Yeah, kinda thought that would be the issue...glad you got it sorted...(y)
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,356
Members
449,080
Latest member
Armadillos

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