ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 880
- Office Version
- 365
- 2019
- Platform
- Windows
I am running into an issue applying the resize property. I recently started learning about it and I have tried so many variations on the below but its not working. Could someone let me know what I am doing wrong? It for some reason is coming with the last 9 records from A to L all as #N/A. Previously I was copying the data and pasting but I am working with a lot of data and testing performance improvements by moving to an approach more like the below.
VBA Code:
'after execution copy from source and paste into relative sheet applying formulas
With WsSec
lastRow = .Cells(WsSec.rows.count, "A").End(xlUp).row 'find the maximum row
End With
On Error Resume Next
If Not Worksheets(SheetName).Name = WsCus.Range("FILTER").Offset(i, -1).Value Then Worksheets.Add.Name = WsCus.Range("FILTER").Offset(i, -1).Value
On Error GoTo 0
With Worksheets(SheetName)
.Range("A1:L" & lastRow).Resize(lastRow).Value = WsSec.Range("A10:L" & lastRow).Value