Results 1 to 5 of 5

Changing font type in a macro

Threaded View

  1. #1
    Registered User
    Join Date
    11-02-2011
    Location
    Midwest, US
    MS-Off Ver
    Excel 2010
    Posts
    43

    Changing font type in a macro

    Found a couple of threads but did not seem to find what I was looking for. It's been a while since I played with Macros ans I was used to 2003 and now I'm using 2010. On a simple Macro like I provided I want to change the font. Thought that I would just type in the .name = "Calibri" section and change the font to Time New Roman for example .name="Times New Roman". The other formatting takes place in the sheet when I run the Macro, but the font still stays as Calibri, what am I doing wrong?

     Sub NameAndTime()
    '
    ' NameAndTime Macro
    ' This macro enters my name and the current time
    '
    ' Keyboard Shortcut: Ctrl+Shift+N
    '
        ActiveCell.FormulaR1C1 = "Where is Waldo"
        ActiveCell.Offset(1, 0).Range("A1").Select
        ActiveCell.FormulaR1C1 = "=NOW()"
        Range("A2").Select
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        ActiveCell.Offset(-1, 0).Range("A1:A2").Select
        ActiveCell.Activate
        Selection.Font.Bold = True
        Selection.Font.Italic = True
        With Selection.Font
            .Name = "Calibri"
            .Size = 18
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ThemeColor = xlThemeColorLight1
            .TintAndShade = 0
            .ThemeFont = xlThemeFontMinor
        End With
    End Sub
    Last edited by dotsofcolor; 12-06-2011 at 12:28 AM. Reason: Put in code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1