Share via

Print without borders

Anonymous
2015-02-08T06:55:19+00:00

Hi guys,

I want to print a selected area in a sheet that has borders in content, I do not want to print the borders as well I want the printed paper just show me the content and not the borders , Can you please help me in this regard?

B.R//

Tedi

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2015-02-08T08:27:35+00:00

I would do it using a macro to copy the range to a new workbook, without the borders, and then print.  Something like:

Sub PrintSelectionWithoutBorders()

  Dim rSelected As Range

  Set rSelected = Selection

  Workbooks.Add xlWorksheet  ' create new single sheet workbook

  rSelected.Copy

  With ActiveSheet.Range(rSelected.Address)

    .PasteSpecial xlPasteAllExceptBorders  'paste into the new workbook without its borders

    .PrintOut  

  End With

  ActiveWorkbook.Close False   ' close the temporary workbook

End Sub

Was this answer helpful?

0 comments No comments

Answer accepted by question author

Anonymous
2015-02-08T08:25:47+00:00

The following VBA Script:

1. Turns on "No Borders" for the current cell range selected.

  1. Prints the selection.
  2. Turns on "All Borders" for the current cell range selected. 

NOTE: The script would need to be customized if you have varying types of borders in your selection.

Sub PrintNoBorders()

'The following turns off borders on the cells currently selected

    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.Borders(xlDiagonalDown).LineStyle = xlNone

    Selection.Borders(xlDiagonalUp).LineStyle = xlNone

'The following prints your selection to your default printer

    Selection.PrintOut Copies:=1, Collate:=True

'The following turns on thin black borders on all cells selected.

    With Selection.Borders(xlEdgeLeft)

        .LineStyle = xlContinuous

        .ColorIndex = 0

        .TintAndShade = 0

        .Weight = xlThin

    End With

    With Selection.Borders(xlEdgeTop)

        .LineStyle = xlContinuous

        .ColorIndex = 0

        .TintAndShade = 0

        .Weight = xlThin

    End With

    With Selection.Borders(xlEdgeBottom)

        .LineStyle = xlContinuous

        .ColorIndex = 0

        .TintAndShade = 0

        .Weight = xlThin

    End With

    With Selection.Borders(xlEdgeRight)

        .LineStyle = xlContinuous

        .ColorIndex = 0

        .TintAndShade = 0

        .Weight = xlThin

    End With

    With Selection.Borders(xlInsideVertical)

        .LineStyle = xlContinuous

        .ColorIndex = 0

        .TintAndShade = 0

        .Weight = xlThin

    End With

    With Selection.Borders(xlInsideHorizontal)

        .LineStyle = xlContinuous

        .ColorIndex = 0

        .TintAndShade = 0

        .Weight = xlThin

    End With

End Sub

As an alternative to the above, a No-Code way to do it would be to create a second worksheet with no borders turned on and use cell references to copy the information over.

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2015-02-08T11:42:16+00:00

    Thanks and regards

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2015-02-08T11:41:58+00:00

    Thanks a lot

    Was this answer helpful?

    0 comments No comments