ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Address Entire Worksheet as a range (https://www.excelbanter.com/excel-programming/356948-address-entire-worksheet-range.html)

Klatuu

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?


Gary Keramidas

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" wrote in message
...
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?




Klatuu

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" wrote in message
...
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?





Klatuu

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" wrote in message
...
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?






All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com