Posted to microsoft.public.excel.programming
|
|
if Stucture help
You can use a user-defined type for this:
Option Explicit
Type TableType
Type As String
TypeName As String
SheetName As String
' etc etc
End Type
Sub testTableType
dim T(10) as TableType
T(1).Type = "x"
T(1).TypeName = "xxx"
' etc etc
End Sub
Alex St-Pierre wrote:
Hi,
I have a program (form) that allow the user to create differents tables and
I have too much function inside VBA that have different input and output.
As example, for TableNumber = 1, there's a Type, TypeName, SheetName,
Title1,Title2,... corresponding with them.
Instead of using all these function (example: temp =
fSheetName(TableType(1))), I could used something like T(1).SheetName. What I
could do is to load the T(10) vector at the opening of the form and refer to
it thereafter.
Structure seems to be the right thing to simplify my program. Since my
program will be used by a lot of people, I'm wondering if it is a good
approach and if it can be used on any VB version? (I used 6.3).
I could use a table (because all datas inside T() are string) but I prefer
to write T(10).Title1 instead of T(10,3). Is there a way to say T(10).Title1
refer to element 3 inside a table T(10,3)?
Thanks a lot!!
--
Alex St-Pierre
|