ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 782
- Office Version
- 365
- 2019
- Platform
- Windows
Hello,
I have a small piece of code that I put together but I am by no means a VBA expert and want to run it by someone with little more experience to see if it is the most efficient way to accomplish what I am trying to do. there is one thing i cannot modify (SecDist2 vba), current code works fine:
I run the secdist2 as many times for data listed in sheet Vs then that updates the parameters for the SecDist2 to run. so update to 1, run secdist2, update to 2, runsecdist2...etc.
I have a small piece of code that I put together but I am by no means a VBA expert and want to run it by someone with little more experience to see if it is the most efficient way to accomplish what I am trying to do. there is one thing i cannot modify (SecDist2 vba), current code works fine:
I run the secdist2 as many times for data listed in sheet Vs then that updates the parameters for the SecDist2 to run. so update to 1, run secdist2, update to 2, runsecdist2...etc.
VBA Code:
Sub SDISALLV2()
Dim i%
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
ActiveSheet.AutoFilterMode = False
i = 1
With Sheets("Vs")
Do Until .Range("VIEW").Offset(i, 0) = ""
Sheets("Sec Dist").Range("SP_VIEW") = .Range("VIEW").Offset(i, 0)
SecDist2
i = i + 1
Loop
End With
Sheets("Sec Dist").Range("SP0_VIEW") = 1
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub