trying to call this subroutine using a string. I have tried Application.Run like I have read online but that doesn't seem to be working. The variable element will loop through and represents different state codes. So I have subs called "CA_Config", "GA_Config" "AZ_Config" etc.
Dim strSubToCall As String
strSubToCall = element & "_Config()"
Application.Run strSubToCall
State subs are very different therefore need to be different subroutines. The other subs and the main sub calling the other ones are all public.
Example for CA sub below
Public Sub CA_Config()
Dim rngLastHeader As Range
Dim intLastRow As Integer
Dim i As Integer
intLastRow = Sheet1.currWS.UsedRange.Rows.Count
Set rngLastHeader = Sheet1.currWS.Range("A1").End(xlToRight)
rngLastHeader.Offset(, 1).Value = "Use Tax Reversal Needed"
Sheet1.currWS.Range("X:X").EntireColumn.Copy
Sheet1.currWS.Range("Y:Y").PasteSpecial xlPasteFormats
Sheet1.currWS.Range("Y:Y").Columns.AutoFit
End Sub
()Subis in another module andPrivate?Sub StateConfig("CA")How different are each of these "state subs"?Subwith module name. For instance,Application.Run "Module1.MySub"