Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Writing an array(2d) of user types to a worksheet
What is the "fast" way to write out a 2d-array of user defined types to a
worksheet. I.E. User type is a record of 10 fields. Which has 30 rows... Type UT field1 as string field2 as string .... field10 as string end type Dim myUDTarray () as UT .... ReDim Preserve myUDTarray(ubound(myUDTarray) + 1) 'adds a row myUDTarray(ubound(myUDTArray)).field1 = "v1" .... myUDTarray(ubound(myUDTArray)).field10 = "v10" Using the set rng = range("a1").cells then copying myUDTarray(x).each field...to the rng.offset(x,y).value in a loop is extremely slow. what are some other options? When I try to write code that uses variant arrays I get a comple error that says my user type must be in a public module... but I do not want the type "public" it is used ONLY in this one module.. however... what is the statement that I would put at the top of the module to allow me to assign the usertype'd array to a worksheet range. If there is some way to build a valid variant array from my user type, perhaps that would work. Ideas? -- Regards, John |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Issue writing IF OR Error Formula Types | New Users to Excel | |||
Writing values to worksheet from array | Excel Programming | |||
User-defined data type; Error: Only User-defined types... | Excel Programming | |||
Unable to add user-defined data types to a collection | Excel Programming |