Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default loop through class module

I have class module (Reqs) with 9 variables declared as

Public Class_01 As String
Public Class_02 As String
Public Class_03 As String
etc

I want to build a string referencing those variables, during the
initialization of a userform, in loop like

for i=1 to 9

x(i)=Reqs(emp).Class_01

next i

using something like "Reqs(emp).Class_0" & i

but I can't figure out how to make it treat the concatenated string as
a property of the class, not a string.

Can someone point me in the right direction on this?

Thanks

Ken



where I build the
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default loop through class module

Have you thought of having the 9 strings in a collection (still within
your class) variable instead?
Then:
- each item in the collection would be the string
- the key for each item would be the variable's name
and then you could call each variable by its name from the colelction
using the collection and your construct of "Class_0" & i
?

On Oct 6, 1:13*pm, wrote:
I have class module (Reqs) with 9 variables declared as

Public Class_01 As String
Public Class_02 As String
Public Class_03 As String
etc

I want to build a string referencing those variables, during the
initialization of a userform, in loop like

for i=1 to 9

x(i)=Reqs(emp).Class_01

next i

using something like "Reqs(emp).Class_0" & i

but I can't figure out how to make it treat the concatenated string as
a property of the class, not a string.

Can someone point me in the right direction on this?

Thanks

Ken

where I build the


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default loop through class module

I thought about that right I after I posted. I think that will be a
better solution.
Thanks
Ken

On Oct 6, 10:39*am, AB wrote:
Have you thought of having the 9 strings in a collection (still within
your class) variable instead?
Then:
- each item in the collection would be the string
- the key for each item would be the variable's name
and then you could call each variable by its name from the colelction
using the collection and your construct of "Class_0" & i
?

On Oct 6, 1:13*pm, wrote:



I have class module (Reqs) with 9 variables declared as


Public Class_01 As String
Public Class_02 As String
Public Class_03 As String
etc


I want to build a string referencing those variables, during the
initialization of a userform, in loop like


for i=1 to 9


x(i)=Reqs(emp).Class_01


next i


using something like "Reqs(emp).Class_0" & i


but I can't figure out how to make it treat the concatenated string as
a property of the class, not a string.


Can someone point me in the right direction on this?


Thanks


Ken


where I build the- Hide quoted text -


- Show quoted text -


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
CLASS MODULE & SIMPLE MODULE FARAZ QURESHI Excel Discussion (Misc queries) 1 September 7th 07 09:32 AM
Class Module vs Normal Module Les Excel Programming 2 July 20th 07 09:54 AM
class module? sybmathics Excel Programming 17 February 25th 06 02:29 PM
Class module Chip Pearson Excel Programming 0 January 19th 05 03:01 PM
Variable from a sheet module in a class module in XL XP hglamy[_2_] Excel Programming 2 October 14th 03 05:48 PM


All times are GMT +1. The time now is 03:23 AM.

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

About Us

"It's about Microsoft Excel"