Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Neverending lines.

I get spreadsheets emailed to me from other people sometimes and they will
sometimes include cells that have borders around them that go on forever. I
know how to set my print area to keep the lines from printing endlessly, but
how do Ijust get rid of them. Deleting them repeatedly doesn't work because
they go on forever.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Neverending lines.

you could click at the junction of the row and column headers so the entire
worksheet is selected, then do Format=Cells, go to the border tab and
unclick any borders.

for code:

Sub RemoveBorders()
With ActiveSheet.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
End With
End Sub

--
Regards,
Tom Ogilvy


"Janie" wrote:

I get spreadsheets emailed to me from other people sometimes and they will
sometimes include cells that have borders around them that go on forever. I
know how to set my print area to keep the lines from printing endlessly, but
how do Ijust get rid of them. Deleting them repeatedly doesn't work because
they go on forever.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Neverending lines.

This a general purpose tidying macro that may help you


Sub OptimizeWorkbook()
Dim ws As Worksheet
Dim lastrow As Long, lastcol As Long
Application.ScreenUpdating = False
On Error Resume Next
For Each ws In ActiveWorkbook.Worksheets
With ws
lastrow = .Cells.Find(what:="*", after:=.Range("A1"), LookIn:=xlValues,
lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlPrevious).Row
lastcol = .Cells.Find(what:="*", after:=.Range("A1"), LookIn:=xlValues,
lookat:=xlPart, searchorder:=xlByColumns,
searchdirection:=xlPrevious).Column
Range(.Cells(1, lastcol + 1), .Cells(65536, 256)).Delete
Range(.Cells(lastrow + 1, 1), .Cells(65536, 256)).Delete
lastrow = .UsedRange.Rows.Count
End With
Next ws
On Error GoTo 0
Application.ScreenUpdating = True
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Neverending lines.

How can I email this spreadsheet to you? I do not think that I am explaining
my dilemma very well.

"Janie" wrote:

I get spreadsheets emailed to me from other people sometimes and they will
sometimes include cells that have borders around them that go on forever. I
know how to set my print area to keep the lines from printing endlessly, but
how do Ijust get rid of them. Deleting them repeatedly doesn't work because
they go on forever.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Neverending lines.

my email is



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
In Excel 2007 chart with multiple lines, mouse doesn't track lines sfuelling Charts and Charting in Excel 1 August 19th 09 09:41 PM
inserted lines move how to place lines in proper cell? Deschi Excel Worksheet Functions 0 February 8th 09 01:15 PM
Inserting Lines or Copying lines with formulas but without data wnfisba Excel Discussion (Misc queries) 2 August 18th 06 04:41 PM
Vertical Lines on the Lines on 2 Axes Chart [email protected] Charts and Charting in Excel 3 March 3rd 06 04:14 AM
excel97 vba to append lines to text file overwriting last 2 lines Paul Excel Programming 1 November 6th 04 08:11 PM


All times are GMT +1. The time now is 09:44 AM.

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

About Us

"It's about Microsoft Excel"