+ Reply to Thread
Results 1 to 2 of 2

Thread: VBA for spreadsheet background color - issues with pivottable

  1. #1
    Registered User
    Join Date
    01-07-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    13

    VBA for spreadsheet background color - issues with pivottable

    I tried VBA code that doesn't work because my pivottable sweeps away (it removes) the background color of my spreadsheet.

    This is what I tried:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Range("A1:CZ2000").Interior.Color = RGB(51, 102, 255)
    End Sub
    The above VBA does work to set the color....but as I use the pivottable, the background color is removed from the spreadsheet.

    Thanks.
    Last edited by pike; 11-29-2011 at 12:08 AM. Reason: add code tags

  2. #2
    Forum Moderator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    4,376

    Re: VBA for spreadsheet background color - issues with pivottable

    Is the pivot table output on the same sheet where you are putting the color?
    Cheers,
    Arlette

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0