Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Break Procedure into 3 Parts

  Asked By: Raynard    Date: Jan 29    Category: MS Office    Views: 847
  

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

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Bama Cohen     Answered On: Jan 29

if I understand correctly, you are attempted to build and
evolve models  after which you wish to generate a report  with a neat
layout.

Given that this is the problem, I may have something interesting to
share with you. I am currently consulting with a company that has
given these issues some thought. They are building a product called
ModelSheet that separates model  logic from sheet layout, while using
web workbooks (similar to Excel workbooks) to visualize the model
during the authoring process. It captures model logic with named
variables that have dimensions, time series and data types. Formulas
are expressed with named variables; they apply to regions of cells, so
there are far fewer formulas. Cell addresses don't exist anywhere. You
can build and evolve your model in ModelSheet, and then export it to
Excel where formulas are expressed with cell addresses. You can also
re-import any values you change in the generated Excel workbook to
update and refine your original model.

You can learn more about the product at http://www.modelsheetsoft.com
If it interests you, they are currently organizing a beta test, and
are looking for participants.

 
Didn't find what you were looking for? Find more on Break Procedure into 3 Parts Or get search suggestion and latest updates.




Tagged: