+ Reply to Thread
Results 1 to 3 of 3

Macro Help / Bold and Highlight current cell

  1. #1
    Registered User
    Join Date
    04-29-2009
    Location
    Rhode Island, USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Macro Help / Bold and Highlight current cell

    Hello,

    I need some help with a macro to Bold the font and chance the background color of the current cell(s) when crtl-q is pressed.

    Below is what I have and it works but for a specific cell. I don't know the code/variable to use for a "current cell".

    Hope someone can help.

    Sub Build()
    '
    ' Keyboard Shortcut: Ctrl+q
    '
    Range("N2").Select
    Selection.Font.Bold = True
    Selection.Font.ColorIndex = 3
    With Selection.Interior
    .ColorIndex = 6
    .Pattern = xlSolid
    End With
    ActiveWindow.SmallScroll Down:=0
    Range("N2").Select
    End Sub
    Thanks!

    B

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro Help / Bold and Highlight current cell

    remove all references to Range("N2") from your code
    ie just work with Selection (which will be the ActiveCell)

    Could be adapted say to:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-29-2009
    Location
    Rhode Island, USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Macro Help / Bold and Highlight current cell

    Thanks for your time and code! Worked like a charm!

    B

+ Reply to Thread

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