John Caines
Well-known Member
- Joined
- Aug 28, 2006
- Messages
- 1,155
- Office Version
- 2019
- Platform
- Windows
Hello All.
I'd really like to insert a check box on my spreadsheet that can toggle on and off that creates a font change for my spreadsheet.
The font I'd like to toggle isn't a std inserted windows font,, but one I've installed in the fonts part of windows 7,, but it should be ok.
What I want to do is insert a check box somewhere on my spreadsheet which is called "ToDo-FULL" & the Target Range of Cells for the font change on my spreadsheet is C4:Q44. If the checkbox is checked it will insert a font called "Throw My Hands Up in the Air", Font Style "Regular", Font Size "12", Colour "Black"
If I uncheck,, it reverts back to the original font (Calibri, 12, reg,black).
I've searched the forum & found maybe a bit of code that might/could be adapted to do it.(I think)
Thing is,, I'm no coder, and I've just tried changing a few details to it,, it didn't work unsurprisingly
It was by a guy called Andrew Poulsom, and his code was;
I tried it as to wing it and just tried..
I'm not sure what
means,, maybe this isn't correct.
Maybe it needs to be completely different code altogether?
If anybody can help me please I'd appreciate it a lot.
It would be a really cool feature, If I could get it to work.
many thanks for your time
All the best
John Caines
I'd really like to insert a check box on my spreadsheet that can toggle on and off that creates a font change for my spreadsheet.
The font I'd like to toggle isn't a std inserted windows font,, but one I've installed in the fonts part of windows 7,, but it should be ok.
What I want to do is insert a check box somewhere on my spreadsheet which is called "ToDo-FULL" & the Target Range of Cells for the font change on my spreadsheet is C4:Q44. If the checkbox is checked it will insert a font called "Throw My Hands Up in the Air", Font Style "Regular", Font Size "12", Colour "Black"
If I uncheck,, it reverts back to the original font (Calibri, 12, reg,black).
I've searched the forum & found maybe a bit of code that might/could be adapted to do it.(I think)
Thing is,, I'm no coder, and I've just tried changing a few details to it,, it didn't work unsurprisingly
It was by a guy called Andrew Poulsom, and his code was;
Code:
'B1 style change
For i = 2 To Sheets.Count
With Sheets(i).Range("B1")
With .Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
End With
With .Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
' Worksheets text in black
With Sheets(i).Cells.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
End With
Next i
Code:
Private Sub Worksheet_Font_Change()
'C5:Q44 style change
For i = 2 To Sheets.Count
With Sheets("i").Range("C5:Q44")
With .Font
.Name = "Throw My Hands Up in the Air"
.FontStyle = "Regular"
.Size = 12
End With
With .Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
' Worksheets text in black
With Sheets("i").Cells.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
End With
Next i
End Sub
I'm not sure what
Code:
For i = 2 To Sheets.Count
Maybe it needs to be completely different code altogether?
If anybody can help me please I'd appreciate it a lot.
It would be a really cool feature, If I could get it to work.
many thanks for your time
All the best
John Caines