Change hyperlink deffault text size

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Hi,
When i apply a hyperlink to some text in a cell it defaults to say size 16 but i would like it at size 11

I have the following but i dont see it change when i leave the cell.
The applied for all cells in column Y

Please advise thanks.

Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim Rng As Range
    Dim cell As Range
    
    Set Rng = Intersect(Target, Range("6:" & Rows.Count), Range("A:L,N:W"))
    
'   Exit if nothing entered into out target range
    If Rng Is Nothing Then Exit Sub
    
'   Loop through all cells in our target range
    Application.EnableEvents = False
    For Each cell In Rng
        cell = UCase(cell)
    Next cell
    Application.EnableEvents = True
    
        If Not Intersect(Target, Range("L6:L" & Range("L" & Rows.Count).Row)) Is Nothing And Target.Cells.Count = 1 Then
    
        Application.EnableEvents = False
        
        With Target
            .Interior.ColorIndex = 6
            .Font.Size = 11
            .BorderAround xlContinuous, xlThin
            .Font.Name = "Calibri"
            .Font.Bold = True
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlVAlignCenter
            
        End With
      
            .Range ("Y6:Y")
            .Interior.ColorIndex = 2
            .Font.Size = 11
            .BorderAround xlContinuous, xlThin
            .Font.Name = "Calibri"
            .Font.Bold = True
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlVAlignCenter
            
        Application.EnableEvents = True
        
    End If
  End Sub
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Column Y is beyond W, so the Intersect always evaluates to Nothing and your procedure ends prematurely.
Rich (BB code):
    Set Rng = Intersect(Target, Range("6:" & Rows.Count), Range("A:L,N:W"))
    
'   Exit if nothing entered into out target range
    If Rng Is Nothing Then Exit Sub
 
Upvote 0
Solution
You are welcome and thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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