Results 1 to 2 of 2

Thread: passing arrays from Class Module

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    1
    Rep Power
    0

    passing arrays from Class Module

    Hi I have a userform in which there are four Frames. Each frame has couple of checkboxes. Now I want that whatever checkboxes user clicks should be displayed in message box. The following code doesn't work as it says arrays cannot be declared as public members in class.

    'Class 2
    Code:
    Private frame_content() As String
    
    
    'Module
    Sub check_valid_combo(ufm As UserForm)
    
    
    Dim frame_collection As New Collection
    Dim frame_array As Frame
    Dim num
    
    
    For i = 1 To 4' no. of frames
    Dim Inst As New Class2
    frame_collection.Add Item:=Inst, Key:=CStr(i)
    
    Set frame_array = ufm.Controls("Frame" & i)
    For Each ctrl In frame_array.Controls
    If TypeName(ctrl) = "CheckBox" Then
    If ctrl.Value Then
    num = num + 1
    ReDim Preserve frame_content(1 To num)
    Inst.frame_content(num) = ctrl.Name
    End If
    End If
    Next ctrl
    
    Set Inst = Nothing
    num = 0
    Next i
    Last edited by Admin; 01-17-2014 at 11:13 PM. Reason: code tag added

  2. #2
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    13
    Please use code tags !!

    You might have a look over here:

    VBA for smarties: VBA check of userinput in a Userform

Similar Threads

  1. Replies: 5
    Last Post: 12-07-2013, 12:35 PM
  2. Manipulate VBA Array Object Using Class Module
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 0
    Last Post: 06-06-2013, 07:53 PM
  3. Filter In Arrays
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 05-28-2013, 08:40 PM
  4. Array Class Module
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 3
    Last Post: 12-20-2012, 11:22 AM
  5. Passing a UDF as return type
    By Junoon in forum Excel Help
    Replies: 0
    Last Post: 05-05-2012, 05:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •