Consulting

Results 1 to 3 of 3

Thread: Highlight The Selected.

  1. #1
    VBAX Contributor
    Joined
    Apr 2010
    Posts
    182
    Location

    Highlight The Selected.

    Hi,

    I'm having the following code that colors the cell A1 when the macro is run.

    How could I modify the code so that it would color any selected cell.

    Any help on this will be kindly appreciated.

    Thanks in advance.
    [vba]Sub Selects()
    Range("A1").Select
    With Selection.Interior
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    .Color = vbYellow
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With
    End Sub[/vba]
    Best Regards,
    adamsm

  2. #2
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    993
    Location
    [vba]Sub Selects()
    With ActiveCell.Interior
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    .Color = vbYellow
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With
    End Sub[/vba]

    David


  3. #3
    VBAX Contributor
    Joined
    Apr 2010
    Posts
    182
    Location
    Thanks for the help. I do really appreciate it.
    Best Regards,
    adamsm

Posting Permissions

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