Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
In Excel 2007 chart with multiple lines, mouse doesn't track lines | Charts and Charting in Excel | |||
inserted lines move how to place lines in proper cell? | Excel Worksheet Functions | |||
Inserting Lines or Copying lines with formulas but without data | Excel Discussion (Misc queries) | |||
Vertical Lines on the Lines on 2 Axes Chart | Charts and Charting in Excel | |||
excel97 vba to append lines to text file overwriting last 2 lines | Excel Programming |