Results 1 to 5 of 5

Thread: VBA Excel - Changing the backcolour of cells

  1. #1

    Thread Starter
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345

    VBA Excel - Changing the backcolour of cells

    Is this possible? If so, how?

    Thanks
    Tom

  2. #2
    Addicted Member
    Join Date
    Jun 2002
    Location
    South West UK
    Posts
    245
    it is possible, but how do you intend to specify the required cells that need altering?
    A lowly programmer.

    http://www.sentinalgroup.com

  3. #3

    Thread Starter
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    well thats what I need to do.

    I am using the following to change the value:
    VB Code:
    1. Sheet1.Cells(4, 5).Value =
    I want somthing similar to change the back colour

  4. #4
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383
    This is what I got recording a macro...

    VB Code:
    1. Range("E5").Select
    2.     With Selection.Interior
    3.         .ColorIndex = 43
    4.         .Pattern = xlSolid
    5.         .PatternColorIndex = xlAutomatic
    6.     End With

    Surely you can do the same and adapt it??

    /Andrew

  5. #5
    Addicted Member
    Join Date
    Jun 2002
    Location
    South West UK
    Posts
    245
    Try this

    Range("F7").Select
    With Selection.Interior
    .ColorIndex = 11 'dark blue. Try other numbers to get what you want
    .Pattern = xlSolid
    End With

    Let me know how you get on
    A lowly programmer.

    http://www.sentinalgroup.com

Posting Permissions

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



Click Here to Expand Forum to Full Width