Formatting Issues

Paste Linked Excel Cells While Preserving Borders

Ayan MasoodAyan Masood Dec 2, 2026 868 views

Question details

Preserve source cell borders when pasting linked cells into an Excel worksheet.

Paste Linked Excel Cells While Preserving Borders
Product
Microsoft Excel
Device & OS
not provided
Scenario
A VBA macro creates linked formulas on a destination sheet, and the user needs the source borders to appear when printing.
Observed behavior
The destination cells contain links but do not retain the source cell borders.
Before you start

Identify the source range and the top-left destination cell. Confirm that the visible lines are applied cell borders, not worksheet gridlines.

Solution 1Recommended

Update the VBA macro to paste links and then formats

Use this method when the links and borders need to be created automatically by a macro.

Paste Link creates the formulas; a separate formats-only paste applies the source formatting without replacing those formulas. The formats paste copies all cell formats, not just borders.

1
Open the VBA editor

In Excel, open Developer > Visual Basic and select the module containing your macro.

2
Paste links and formats separately

Adapt this example to your sheet names and ranges: Sub PasteLinkedCellsWithBorders() Dim sourceRange As Range Dim destinationCell As Range Set sourceRange = ThisWorkbook.Worksheets("Sheet1").Range("A1:C5") Set destinationCell = ThisWorkbook.Worksheets("Sheet2").Range("A1") sourceRange.Copy destinationCell.Worksheet.Activate destinationCell.Select ActiveSheet.Paste Link:=True sourceRange.Copy destinationCell.PasteSpecial Paste:=xlPasteFormats Application.CutCopyMode = False End Sub

3
Run and check the result

Run the macro from Developer > Macros. Check that destination cells contain linked formulas, then open File > Print to preview the borders.

Update the VBA macro to paste links and then formats
Existing destination formatting: Pasting formats can replace destination number formats, fonts, fills, and alignment as well as borders.
Free Microsoft Office alternative

Work with formatted spreadsheets in WPS Office

WPS Office is a free, lightweight alternative for working with spreadsheets in a familiar interface. Open compatible Excel files and continue editing with minimal migration, though it does not fix an Excel VBA macro.

Edit spreadsheet cells and apply borders for printingCompatible with Microsoft Excel XLS and XLSX formatsUse a familiar spreadsheet interfaceMove existing Office documents into a lightweight application
microsoft office alternative - wps office

Frequently Asked Questions

Why do my linked cells not have the source borders?

Paste Link creates formulas that refer to the source cells, but it does not necessarily copy their formatting. Copy the source again and use Home > Paste > Paste Special > Formats on the destination.

Will pasting formats remove my linked formulas?

No. Paste Special > Formats applies cell formatting without replacing the linked formulas. It can, however, replace other destination formatting such as number formats and fills.

How can I tell whether the lines are borders or gridlines?

Select the source cells and inspect the Borders menu on the Home tab. Gridlines are worksheet display lines; applied borders are cell formatting that can be copied with Paste Special > Formats.

How do I check whether the borders will print?

Open File > Print and inspect the print preview. If the lines are gridlines rather than borders, check the worksheet's gridline print settings or apply cell borders from the Home tab.