Copy-Paste as link but also with cell borders?

Occasional Contributor


Attached is a sample file.


I have written a macro that copies a subset of cells from the source sheet and pastes it into a new sheet as LINKED, enabling the new sheet to update if the source sheet updates. This is done in VBA, so it's a click of a button for the users. That's great...



I print the resulting sheet for use on the shop floor and they need the underline from the cells on the source to be printed.


So, please let me know how to copy and paste both AS LINKED and with CELL BORDERS? The commented-out line using xlPasteFormats does not work. 


Here is the section of code I have (and it is working as expected):


                ' Perform the copy and paste from Sheet(1) to Sheet("16mmHPL CSV")
                    ActiveSheet.Paste Link:=True
                    'ActiveSheet.Paste Format:=xlPasteFormats


2 Replies


Untested, but should work :))


Insert_formatlink ()
Sheets ("Sheet1"). Range ("Area2"). EntireRow.Copy
Sheets ("Sheet1"). Range ("Area2"). EntireRow.Insert Shift: = xlDown, CopyOrigin: = _
Sheets ("Sheet1"). Range ("Area2"). Offset (-1) .EntireRow.ClearContents
End Sub 



I would be happy to know if I could help.



I know I don't know anything (Socrates)


Was the answer useful? Mark them as helpful!

This will help all forum participants.

@NikolinoDE  - Thanks for your input, but that's not working for me. I need to paste as a link and with source cell formatting (underline or no underline).


Note that in my sample file that on the PASTE_LINKED sheet there are only 10 columns. They are sheet SOURCE_PAGE columns U through AD. These are the only columns I need to copy over.


Again, thanks fort the effort though!