ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add a border to pasted cells (https://www.excelbanter.com/excel-programming/358381-add-border-pasted-cells.html)

Jon[_21_]

Add a border to pasted cells
 
I am trying to place a border around some cells I pasted using a macro.
My problem is that I don't know the location of the pasted cells
because I am pasting to the next empty row below other data. See below:

Set rng = Sheets("files").Cells(Rows.count, 2).End(xlUp)(2).Offset(2,
0)

range("C3:D5").Copy
rng.PasteSpecial xlFormats
rng.PasteSpecial xlValues

Is there a way I can place a border around the pasted cells with just
the info from this code?


Jon[_21_]

Add a border to pasted cells
 
Nevermind, I got it. Just had to activate the sheet:

Sheets("files").Activate
Selection.Borders(xlEdgeTop).LineStyle = xlDouble



All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com