View Single Post
 
Old 10-04-2020, 05:39 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The font colour can also be changed by adding this line
Code:
Sub SetLabels(sLabel As String, aSheet As Worksheet)
  Dim aCtl As Control, lngColour As Long, aShape As Shape
  Select Case sLabel
    Case "Warning":  lngColour = RGB(120, 0, 0)
    Case "Caution":  lngColour = RGB(0, 120, 0)
    Case Else:       lngColour = RGB(0, 0, 120)
  End Select
  
  For Each aShape In aSheet.Shapes
    If aShape.Title = "Label" Then
      aShape.TextFrame2.TextRange.Text = sLabel
      aShape.Line.ForeColor.RGB = lngColour
      aShape.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = lngColour
    End If
  Next aShape
  
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote