Change hyperlink deffault text size

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
3,913
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
 

Some videos you may like

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.

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows
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
 
Solution

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows
You are welcome and thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,128,020
Messages
5,628,181
Members
416,297
Latest member
Kara Payne

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
Top