Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In my entire workbook, I want to be able to change of the font of a cell when
the cell has a hyperlink in it. This VB works if you paste it in each worksheet: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Hyperlinks.Count = 1 Then Target.Select With Selection.Font .Color = -16776961 .TintAndShade = 0 End With End Sub but instead of pasting 100+ worksheets in the workbook, where should I place this code? -- Steve |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Steve,
The workbook-sheet change applies to all sheets. Alt+F11 to open VB editor. Double click 'This workbook' and paste this in on the right Note I've commented out .tintshade because that doesn't work in 2003 in fact i'm only assuming it works in another version, I've never heard of it Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If Target.Hyperlinks.Count = 1 Then Target.Select With Selection.Font .Color = -16776961 '.TintAndShade = 0 End With End Sub Mike "Steve" wrote: In my entire workbook, I want to be able to change of the font of a cell when the cell has a hyperlink in it. This VB works if you paste it in each worksheet: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Hyperlinks.Count = 1 Then Target.Select With Selection.Font .Color = -16776961 .TintAndShade = 0 End With End Sub but instead of pasting 100+ worksheets in the workbook, where should I place this code? -- Steve |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Mike,
Thank you so much, it works perfect! -- Steve "Mike H" wrote: Steve, The workbook-sheet change applies to all sheets. Alt+F11 to open VB editor. Double click 'This workbook' and paste this in on the right Note I've commented out .tintshade because that doesn't work in 2003 in fact i'm only assuming it works in another version, I've never heard of it Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If Target.Hyperlinks.Count = 1 Then Target.Select With Selection.Font .Color = -16776961 '.TintAndShade = 0 End With End Sub Mike "Steve" wrote: In my entire workbook, I want to be able to change of the font of a cell when the cell has a hyperlink in it. This VB works if you paste it in each worksheet: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Hyperlinks.Count = 1 Then Target.Select With Selection.Font .Color = -16776961 .TintAndShade = 0 End With End Sub but instead of pasting 100+ worksheets in the workbook, where should I place this code? -- Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
event | Excel Discussion (Misc queries) | |||
Workbook_Open() Event | Excel Discussion (Misc queries) | |||
Change event? | Excel Discussion (Misc queries) | |||
It seems to me that I need an event Macro, | Excel Worksheet Functions | |||
Event Macro | Excel Discussion (Misc queries) |