Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Looping through a Type

I'm doubtful you can do what you want with a User Defined Type. Is there
any possibility that a 2 dimensional array would work? Say
rArchive(1).sName is rArchive(1)(1) and rArchive(1).iValue is
rArchive(1)(2), etc., out through rArchive(1)(95) and then on to
rArchive(2)(1), etc, if I follow you.

--
Jim
"J Streger" wrote in message
...
|I have a formula that pulls into an array (icolumnpos) the column position
on
| a sheet. This array is set as a User Defined Type. (icolumnpos.sName or
| icolumnpos.iValue).
|
| I also have an array with information, using a similar but different named
| user defined type, to store information based on category
(rArchive(1).sName
| or rArchive(54).ivalue).
|
| I have code at this point that enters information into the sheet, matching
| up column position to the array, but it is all hardcoded. I have 95 lines
of
| code, each telling the code to put this array result into this column. The
| only difference between each line is the .sName or .ivalue portions, and
they
| are the same on both sides of the equation for each. Example:
|
| cells(iwparray,icolumnpos.sname).value = rarchive(inewwp).sname
|
| The for next statement increases iwparray and inewwp each loop through.
|
| I was trying to write something like this:
|
| dim vcell as variant
|
| For Each vCell In icolumnpos
| Worksheets("Workpackages").Cells(iWPArray,
| iColumnPos.vCell).Value = rArchive(iNewWP).vCell
| Next
|
| but this doesn't work. Any suggestions on hwo to make this looping
statement
| work rather than write the line 95 some times? Any help would be most
| appreciated!!! Thanks.
| --
| *********************
| J Streger
| MS Office Master 2000 ed.
| MS Project White Belt 2003
|


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel will not let me type any characters....I can type in Word. deholly Excel Discussion (Misc queries) 1 March 17th 06 10:34 AM
Excel will not let me type any characters....I can type in Word. deholly Excel Discussion (Misc queries) 0 March 17th 06 10:20 AM
how to change all the words of one type(Gunsuh type)to another metumevlut Excel Discussion (Misc queries) 2 November 11th 05 03:29 PM
Adding new 'Type' to Format->Number->Time->Type Chip Pearson Excel Discussion (Misc queries) 5 September 26th 05 08:45 PM
looping through to assign type acarril[_4_] Excel Programming 0 July 23rd 04 08:38 PM


All times are GMT +1. The time now is 09:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"