ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 793
- Office Version
- 365
- 2019
- Platform
- Windows
Hello - I am fairly basic on all my VBA, I have yet to find the best way on certain approaches. One approach is below, is there a better, faster, or more efficient way? i want to run my VBA "sec2" for each view on another sheet called views, then loop until it is finished.
way to capture the below?
VBA Code:
Sub TRAN()
Dim i%
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
ActiveSheet.AutoFilterMode = False
Sheets("TRANS").Activate
Call Clear
i = 1
With Sheets("Views")
Do Until .Range("VIEW").Offset(i, 0) = ""
Sheets("TRANS").Range("SP") = .Range("VIEW").Offset(i, 0)
Call Sec2
i = i + 1
Loop
End With
If Not ActiveSheet.AutoFilterMode Then ActiveSheet.Range("10:10").AutoFilter
Application.Calculation = xlCalculationAutomatic
With ActiveWindow
.SplitColumn = 9
.SplitRow = 10
.FreezePanes = True
End With
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
End Sub