I have a script, a very simple script, which is part of a much larger script, and right now this last bit is giving me issues and I don’t know why.
This is the part of the script that is giving me problems.
Option Explicit
Sub Test()
Dim wsJL As Worksheet 'Jobs List
Dim lastrow As Long
Set wsJL = Sheets("Jobs List")
lastrow = wsJL.Range("B" & Rows.Count).End(xlUp).Row
wsJL.Range("B3:N3").Copy
wsJL.Range("B4:N" & lastrow).PasteSpecial xlPasteFormats
End Sub
Here is the workbook.
https://dl.dropbox.com/u/3327208/Excel/format.xlsm
As far as I can tell what I am doing should not be happening. What is happening is it overwrites everything, instead of replacing the format with what was originally copied.
Can someone please attempt to reproduce thisand tell me where my mistake is?
Thanks.
You can do the same thing without copying and pasting. It requires a little more code, but doesn’t use the clipboard and doesn’t select anything on your sheet.
It runs dramatically faster. I’d be curious to know if this works better on your work computer than what you have already tried.
Try this: