+ Reply to Thread
Results 1 to 4 of 4

Address Entire Worksheet as a range

  1. #1
    Klatuu
    Guest

    Address Entire Worksheet as a range

    What would be the correct syntax to address an entire worksheet as a range.
    What I am doing is using Automation from Access to create, load data into,
    and format a worksheet. I have done this several times, but have a new
    problem.

    The first thing I want to do is make all the borders in the worksheet
    invisible.
    Normally, the code would be:
    xlsheet.range("A1:IV65536").borders.linestype = xllinestypenone
    Is there a shortcut way to do this?


  2. #2
    Gary Keramidas
    Guest

    Re: Address Entire Worksheet as a range

    cells will select all cells

    maybe something like this

    With Cells
    .Borders(xlDiagonalDown).LineStyle = xlNone
    .Borders(xlDiagonalUp).LineStyle = xlNone
    .Borders(xlEdgeLeft).LineStyle = xlNone
    .Borders(xlEdgeTop).LineStyle = xlNone
    .Borders(xlEdgeRight).LineStyle = xlNone
    .Borders(xlInsideVertical).LineStyle = xlNone
    .Borders(xlInsideHorizontal).LineStyle = xlNone

    End With

    --


    Gary


    "Klatuu" <Klatuu@discussions.microsoft.com> wrote in message
    news:6EBDECFF-271B-4DE9-A8D9-D15ACE1DB7BC@microsoft.com...
    > What would be the correct syntax to address an entire worksheet as a range.
    > What I am doing is using Automation from Access to create, load data into,
    > and format a worksheet. I have done this several times, but have a new
    > problem.
    >
    > The first thing I want to do is make all the borders in the worksheet
    > invisible.
    > Normally, the code would be:
    > xlsheet.range("A1:IV65536").borders.linestype = xllinestypenone
    > Is there a shortcut way to do this?
    >




  3. #3
    Klatuu
    Guest

    Re: Address Entire Worksheet as a range

    Thanks, Gary, Actually, to condense it:
    xlsheet.cells.borders.linestyle = xlnone
    worked.
    When I go to print preview, the borders are all gone; however, in the
    workbook I was given to copy, you don't see any grid lines in normal view.
    What property do I need to set to make them disappear?

    "Gary Keramidas" wrote:

    > cells will select all cells
    >
    > maybe something like this
    >
    > With Cells
    > .Borders(xlDiagonalDown).LineStyle = xlNone
    > .Borders(xlDiagonalUp).LineStyle = xlNone
    > .Borders(xlEdgeLeft).LineStyle = xlNone
    > .Borders(xlEdgeTop).LineStyle = xlNone
    > .Borders(xlEdgeRight).LineStyle = xlNone
    > .Borders(xlInsideVertical).LineStyle = xlNone
    > .Borders(xlInsideHorizontal).LineStyle = xlNone
    >
    > End With
    >
    > --
    >
    >
    > Gary
    >
    >
    > "Klatuu" <Klatuu@discussions.microsoft.com> wrote in message
    > news:6EBDECFF-271B-4DE9-A8D9-D15ACE1DB7BC@microsoft.com...
    > > What would be the correct syntax to address an entire worksheet as a range.
    > > What I am doing is using Automation from Access to create, load data into,
    > > and format a worksheet. I have done this several times, but have a new
    > > problem.
    > >
    > > The first thing I want to do is make all the borders in the worksheet
    > > invisible.
    > > Normally, the code would be:
    > > xlsheet.range("A1:IV65536").borders.linestype = xllinestypenone
    > > Is there a shortcut way to do this?
    > >

    >
    >
    >


  4. #4
    Klatuu
    Guest

    Re: Address Entire Worksheet as a range

    Never mind, I got it.

    xlsheet.activate
    xlapp.activewindow.displaygridlines = false

    Thanks again for the help.

    "Gary Keramidas" wrote:

    > cells will select all cells
    >
    > maybe something like this
    >
    > With Cells
    > .Borders(xlDiagonalDown).LineStyle = xlNone
    > .Borders(xlDiagonalUp).LineStyle = xlNone
    > .Borders(xlEdgeLeft).LineStyle = xlNone
    > .Borders(xlEdgeTop).LineStyle = xlNone
    > .Borders(xlEdgeRight).LineStyle = xlNone
    > .Borders(xlInsideVertical).LineStyle = xlNone
    > .Borders(xlInsideHorizontal).LineStyle = xlNone
    >
    > End With
    >
    > --
    >
    >
    > Gary
    >
    >
    > "Klatuu" <Klatuu@discussions.microsoft.com> wrote in message
    > news:6EBDECFF-271B-4DE9-A8D9-D15ACE1DB7BC@microsoft.com...
    > > What would be the correct syntax to address an entire worksheet as a range.
    > > What I am doing is using Automation from Access to create, load data into,
    > > and format a worksheet. I have done this several times, but have a new
    > > problem.
    > >
    > > The first thing I want to do is make all the borders in the worksheet
    > > invisible.
    > > Normally, the code would be:
    > > xlsheet.range("A1:IV65536").borders.linestype = xllinestypenone
    > > Is there a shortcut way to do this?
    > >

    >
    >
    >


+ 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