ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 843
- Office Version
- 365
- 2019
- Platform
- Windows
Is there a way for me to run a macro designed for a particular sheet using WITH? My current approach seems inefficient. I don't think it causes me time drag but I am trying to optimize anywhere I can. Do I really need to activate the sheet in order to run the macro designed for that sheet?
VBA Code:
'clear and set filters
With WsSec
.Range("H2:J6").Cells.ClearContents
.Range("8:8").Cells.ClearContents
.Range("ACCT") = F
.Range("V") = V
.Range("DATE") = RUN
.Range("1ITEM") = "G"
.Range("1OP") = "="
.Range("1VALUE") = "S"
.Range("A8:D8") = Array("D", "4", "A", "U")
.Activate
.Range("A10").CurrentRegion.Delete
End With
'clear and run
Call Sec2