We help IT Professionals succeed at work.
Get Started

Change Font Type based on cell value

Cynthia Hill
Cynthia Hill asked
on
503 Views
Last Modified: 2012-05-12
I am trying to come up with some VBA code to change the font type of a cell (3 cells actually), based on the value of a cell on a separate spreadsheet.  

I've researched some of the past solutions to get a starting point, but I've gotten as far as I can on my own.  Here is the code I have so far... (see below)

It doesn't seem to like the section starting with "Sheets("Supporting Detail").Range("I46:I48").Cell.Font

Any thoughts???
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Sheets("Drop-Down Selections").Range("B124").Value = "HC" Then
Sheets("Supporting Detail").Range("I46:I48").Cell.Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 8
.Superscript = False
Else
Sheets("Supporting Detail").Range("I46:I48").Cell.Font
.Name = "Wingdings3"
.FontStyle = "Regular"
.Size = 9
.Superscript = False
End If
Application.ScreenUpdating = True
End Sub

Open in new window

Comment
Watch Question
Analyst Assistant
CERTIFIED EXPERT
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE