+ Reply to Thread
Results 1 to 8 of 8

How to create collections & objects from range

  1. #1
    Registered User
    Join Date
    04-26-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    23

    How to create collections & objects from range

    A B C D
    1 Collection Property 1 Property 2 Property 3
    2 object1
    3 object2
    4 object3

    How to make objects and collection from worksheet range?

    Suppose the name of collection is at ("A1"), objects in Column "A", and properties of objects in first row.


    thanks in advance

  2. #2
    Registered User
    Join Date
    10-15-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003/2010
    Posts
    22

    Re: How to create collectoins & objects from range

    I don't think that you could easily declare the name of a collection on a worksheet. It would have to be in the code. However, the rest of your idea should be feasible. After refreshing my own knowledge with 45 minutes of research I have reached the conclusion that a custom class will be the best solution, for reasons you only find out after you have set up everything in a way that appeared easier at first. I would follow the advice of Chip Pearson in this case. You may follow this link,
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-26-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: How to create collectoins & objects from range

    Thanks for the effort taken, I had gone through the link, but not sure how it will work for my problem.

  4. #4
    Registered User
    Join Date
    10-15-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003/2010
    Posts
    22

    Re: How to create collections & objects from range

    Try to apply it and share the difficulties you encounte, if any.

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: How to create collections & objects from range

    Normally I'd agree that a collection of classes would be best as suggested, however that would require you to know all your properties in advance where you might not.

    A collection of collections offers more flexibility, that said, I don't think you've provided enough information to go on, what do you want to do with the data? That will dictate the approach you take.

    Example collection of collections:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-26-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: How to create collections & objects from range

    Thanks for your reply.
    First i will develop code which i will implement on user form later on.
    As there are many input table, I want a micro which will generate objects with property on which am going to implement method. Also I want the objects which are created to be box data type, so there will not be any mismatch
    In attached sheet, the solver in code will generate mass, volume etc. values these values are compared with available list value.
    As my program to be generic so am using Object-oriented programming (OOP)
    Attached Files Attached Files

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: How to create collections & objects from range

    Sorry, I've really no idea what you're trying to do.

    Why are you trying to make things object orientated? You've got some really random unrelated classes in your workbook.

  8. #8
    Registered User
    Join Date
    04-26-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: How to create collections & objects from range

    It seems very difficult, i should drop idea of making objects from range.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1