ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,226
- Office Version
- 2007
- Platform
- Windows
Hi,
The value in cell B is font size 12 but when i hyperlink the value it changes to 16
What must i do so after the hyperlink its 12 NOT 16
If i use my code in the select change event it works fine.
BUT if i use the same code in the change event the font size will stay at 16
Do you see why or did i miss something ?
Thanks
The value in cell B is font size 12 but when i hyperlink the value it changes to 16
What must i do so after the hyperlink its 12 NOT 16
If i use my code in the select change event it works fine.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
Dim LastRow As Long
LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
If Intersect(Target, Range("A8:I" & LastRow)) Is Nothing Then Exit Sub
If Target.Column <> 4 And Target.Column <> 7 Then
Range("A8:C" & LastRow).Interior.ColorIndex = 6
Range("E8:F" & LastRow).Interior.ColorIndex = 6
Range("H8:I" & LastRow).Interior.ColorIndex = 6
Target.Interior.ColorIndex = 8
End If
[COLOR=rgb(184, 49, 47)] Application.ScreenUpdating = True
Range("A8:I5000").Font.Size = 12
Range("A8:I5000").Font.Bold = True
Range("A8:I5000").HorizontalAlignment = xlCenter
Range("B8:B5000").VerticalAlignment = xlCenter
Range("B8:B5000").Font.Size = 12[/COLOR]
End Sub
BUT if i use the same code in the change event the font size will stay at 16
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 And Target.Row > 9 Then
If Target.Cells.CountLarge > 1 Then Exit Sub
If Target.Value = "" Then Target.Interior.Color = vbRed
End If
Application.ScreenUpdating = True
Range("A8:I5000").Font.Size = 12
Range("A8:I5000").Font.Bold = True
Range("A8:I5000").HorizontalAlignment = xlCenter
Range("B8:B5000").VerticalAlignment = xlCenter
Range("B8:B5000").Font.Size = 12
End Sub
Do you see why or did i miss something ?
Thanks