+ Reply to Thread
Results 1 to 5 of 5

How to make white background

  1. #1
    Registered User
    Join Date
    11-26-2007
    Posts
    9

    How to make white background

    I have a requirement to make the background of a excal sheet white.
    It should not show any grid of lines.
    How to make this in VBA.

    I did it like
    Please Login or Register  to view this content.
    But this code will effect only the cells from A1 to AZ1000.
    is there any generic code to make the complete worksheet's background as white.
    Thanks,
    lakshmi
    Last edited by VBA Noob; 11-26-2007 at 03:29 PM.

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    if you just want to get rid off the gridlines go to Tools, Options, View and remove the "tick" from the GridLines checkbox!
    Not all forums are the same - seek and you shall find

  3. #3
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    Replace the Range("A1:AZ1000") with Cells

    Please Login or Register  to view this content.
    HTH

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You really only need Simn's suggestion. If you want code you could have used the macro recorder whilst following Simon's suggestion.

    Here's three ways to use VBA to achieve this

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Thanks Roy!, a word of warning Narayana, using
    Replace the Range("A1:AZ1000") with Cells


    Code:
    Sub main()
    Cells.Borders.LineStyle = xlLineStyleNone
    Cells.Interior.Pattern = xlPatternSolid
    Cells.Interior.PatternColor = RGB(255, 255, 255)
    End Sub
    will result in the size of your workbook expanding but following
    'Toggle on or off
    ActiveWindow.DisplayGridlines = Not ActiveWindow.DisplayGridlines
    'hide Gridlines
    ActiveWindow.DisplayGridlines = False
    'display gridlines
    ActiveWindow.DisplayGridlines = True
    will hardly make any difference to size whatsoever and following
    Tools, Options, View and remove the "tick" from the GridLines checkbox
    will make no size difference!

+ 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