I have bumped in a little problem. I want to Delete some rows with VBA, but i want to avoid using Activate or select statements. The problem is, that if i don't activate the workbook, my code returns an error when deleting or copying rows.
With Template.Worksheets("1").Range("A3").CurrentRegion
rCountS = .Rows(.Rows.Count).Row
.Range("A4", Cells(rCountS, 1)).EntireRow.Delete
End With
The .Range part returns an error below:
Run-time error '1004': Application-defined or object-defined error
Is there a way to avoid using activate when deleting rows in Excel?
Thank you
Cells(rCount...
but.Cells(rCount...
(dot was skipped) – JohnSUN