Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Removing Border lines and colour for All sheets

Hi Everyone,

is it possible to write a macro to run every sheet and just remove
border lines and colours for all cells in a sheet for every sheets in
a workbook?

I know macro is like this but can't really think how I can loop this.

Can anyone help?


Thanks alot


Cells.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Selection.Interior.ColorIndex = xlNone




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Removing Border lines and colour for All sheets

just to add to your code

Sub remove_Borders()
Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets
With ws.Cells
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
.Interior.ColorIndex = xlNone
End With
Next
End Sub

--


Gary Keramidas
Excel 2003


"James" wrote in message
...
Hi Everyone,

is it possible to write a macro to run every sheet and just remove
border lines and colours for all cells in a sheet for every sheets in
a workbook?

I know macro is like this but can't really think how I can loop this.

Can anyone help?


Thanks alot


Cells.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Selection.Interior.ColorIndex = xlNone





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Removing Border lines and colour for All sheets

I think the code can be shorted to this...

Sub Remove_Borders()
Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
With WS.Cells
.Borders.LineStyle = xlNone
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Interior.ColorIndex = xlNone
End With
Next
End Sub

--
Rick (MVP - Excel)


"Gary Keramidas" <GKeramidasAtMSN.com wrote in message
...
just to add to your code

Sub remove_Borders()
Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets
With ws.Cells
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
.Interior.ColorIndex = xlNone
End With
Next
End Sub

--


Gary Keramidas
Excel 2003


"James" wrote in message
...
Hi Everyone,

is it possible to write a macro to run every sheet and just remove
border lines and colours for all cells in a sheet for every sheets in
a workbook?

I know macro is like this but can't really think how I can loop this.

Can anyone help?


Thanks alot


Cells.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Selection.Interior.ColorIndex = xlNone






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Removing Border lines and colour for All sheets

On Feb 15, 2:55*pm, "Rick Rothstein"
wrote:
I think the code can be shorted to this...

Sub Remove_Borders()
* Dim WS As Worksheet
* For Each WS In ThisWorkbook.Worksheets
* * With WS.Cells
* * * .Borders.LineStyle = xlNone
* * * .Borders(xlDiagonalDown).LineStyle = xlNone
* * * .Borders(xlDiagonalUp).LineStyle = xlNone
* * * .Interior.ColorIndex = xlNone
* * End With
* Next
End Sub

--
Rick (MVP - Excel)

"Gary Keramidas" <GKeramidasAtMSN.com wrote in message

...



just to add to your code


Sub remove_Borders()
Dim ws As Worksheet


For Each ws In ThisWorkbook.Worksheets
With ws.Cells
* *.Borders(xlDiagonalDown).LineStyle = xlNone
* *.Borders(xlDiagonalUp).LineStyle = xlNone
* *.Borders(xlEdgeLeft).LineStyle = xlNone
* *.Borders(xlEdgeTop).LineStyle = xlNone
* *.Borders(xlEdgeBottom).LineStyle = xlNone
* *.Borders(xlEdgeRight).LineStyle = xlNone
* *.Borders(xlInsideVertical).LineStyle = xlNone
* *.Borders(xlInsideHorizontal).LineStyle = xlNone
* *.Interior.ColorIndex = xlNone
* *End With
Next
End Sub


--


Gary Keramidas
Excel 2003


"James" wrote in message
....
Hi Everyone,


is it possible to write a macro to run every sheet and just remove
border lines and colours for all cells in a sheet for every sheets in
a workbook?


I know macro is like this but can't really think how I can loop this.


Can anyone help?


Thanks alot


* *Cells.Select
* *Selection.Borders(xlDiagonalDown).LineStyle = xlNone
* *Selection.Borders(xlDiagonalUp).LineStyle = xlNone
* *Selection.Borders(xlEdgeLeft).LineStyle = xlNone
* *Selection.Borders(xlEdgeTop).LineStyle = xlNone
* *Selection.Borders(xlEdgeBottom).LineStyle = xlNone
* *Selection.Borders(xlEdgeRight).LineStyle = xlNone
* *Selection.Borders(xlInsideVertical).LineStyle = xlNone
* *Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
* *Selection.Interior.ColorIndex = xlNone- Hide quoted text -


- Show quoted text -


thanks alot everyone
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Border Colour CyberPhile Excel Discussion (Misc queries) 1 May 3rd 09 03:49 PM
Removing border around Check box Flash in the Pan Excel Programming 0 June 10th 08 09:57 PM
changing colour of cell border jacobite Excel Discussion (Misc queries) 4 November 20th 07 11:09 AM
Removing hyperlink without removing the font settings /border sett San Excel Programming 2 September 27th 07 04:37 PM
Colour negative border differently Mark Stephens Charts and Charting in Excel 1 August 10th 05 08:44 AM


All times are GMT +1. The time now is 02:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"