I want to break a procedure into three parts i.e. calculating Models in separate
procedures, then combining in main procedure to create report.
NumberOfSites = 3
Dim site (1 To 4)
Dim TIMEPULL As String
Dim model As String
Model = “abc”
Site (1) = “John”
TIMEPULL = "SELECT count(XX.N25SEL_VAL0)/60”
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=ORDAS;UID=ABCDEF;PWD=12345;SERVER=EVN4.TE.CE.com;",
Destination:=Cells((2 * i - 1), 8))
.CommandText = TIMEPULL
.Refresh BackgroundQuery:=False
End With
Model = “def”
Site (2) = “Mike”
TIMEPULL = "SELECT count(XX.N25SEL_VAL0)/60”
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=ORDAS;UID=ABCDEF;PWD=12345;SERVER=EVN4.TE.CE.com;",
Destination:=Cells((2 * i - 1), 8))
.CommandText = TIMEPULL
.Refresh BackgroundQuery:=False
End With
Model = “ghi”
Site (3) = “Buddy”
TIMEPULL = "SELECT count(XX.N25SEL_VAL0)/60”
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=ORDAS;UID=ABCDEF;PWD=12345;SERVER=EVN4.TE.CE.com;",
Destination:=Cells((2 * i - 1), 8))
.CommandText = TIMEPULL
.Refresh BackgroundQuery:=False
End With