Add a border to pasted cells

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

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?
 
Nevermind, I got it. Just had to activate the sheet:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top