richard blaine
Board Regular
- Joined
- May 19, 2005
- Messages
- 67
For instance: the font color of B1 is determined by the font color of A1; if A1 is red, then B1 will be red.
Thanks
Thanks
Option Explicit
Sub MatchFont()
Dim RNG As Range
On Error Resume Next
Set RNG = Application.InputBox("Use your mouse to select range of cells whose fonts you wish to match.", "My Font Thingy", , , , , 8)
If Err.Number <> 0 Then
End
Else
Selection.Font.ColorIndex = Range(RNG.Address).Font.ColorIndex
Selection.Font.FontStyle = Range(RNG.Address).Font.FontStyle
Selection.Font.Underline = Range(RNG.Address).Font.Underline
Selection.Font.Name = Range(RNG.Address).Font.Name
Selection.Interior.ColorIndex = Range(RNG.Address).Interior.ColorIndex
Selection.HorizontalAlignment = Range(RNG.Address).HorizontalAlignment
Selection.VerticalAlignment = Range(RNG.Address).VerticalAlignment
Selection.WrapText = Range(RNG.Address).WrapText
Selection.Orientation = Range(RNG.Address).Orientation
Selection.ShrinkToFit = Range(RNG.Address).ShrinkToFit
End If
End Sub