+ Reply to Thread
Results 1 to 3 of 3

Working with Control Properties and Arrays

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Surrey, BC
    MS-Off Ver
    Excel 2016
    Posts
    84

    Working with Control Properties and Arrays

    Hi there, not sure if this is possible but I am trying to create three arrays (here is an example), one that collects the check values from A1:A5, the second gathers the values from B1:B5 and the third which stores control properties in an array {"Enabled","MaxLength","Locked","TextAlign","SpecialEffect"}

    Column 'A' would have either a Yes or No value in each cell.
    Column 'B' might have values from row 1 to 5 like: (Row1: True, Row2: 5, Row3: False, Row4: fmTextAlignCenter, Row5: fmSpecialEffectSunken)

    What I would like to do is run a for next loop that assigns a property value to a TextBox property (could be a variety of controls, the reason for the Yes/No check) if the array1 value = Yes then;

    Please Login or Register  to view this content.
    Is something like this possible? I have tried different declare types for the properties in array3 with no avail.

    Thanks
    Craig

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Working with Control Properties and Arrays

    CallByName function is the one you are looking for.

  3. #3
    Registered User
    Join Date
    10-18-2012
    Location
    Surrey, BC
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Working with Control Properties and Arrays

    Thanks, figured it out... CallByName works, took me a while to get it work correctly.

    Here is how I used it.
    Please Login or Register  to view this content.

    This will really shorten the lines of code I would have used!

    Thanks Again
    Craig

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Index of ActiveX control properties.
    By JO505 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2013, 06:00 PM
  2. Control properties color pallette
    By racudd in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-24-2008, 03:13 AM
  3. Cell properties & Arrays
    By Dohko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2007, 09:20 PM
  4. [SOLVED] How to control chart properties from worksheet
    By Marko Pinteric in forum Excel General
    Replies: 3
    Last Post: 04-05-2006, 07:40 AM
  5. [SOLVED] How to control chart properties from worksheet
    By Marko Pinteric in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-05-2006, 07:40 AM
  6. Spinner Control Properties
    By rpalmer4 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-13-2005, 05:45 PM
  7. [SOLVED] Multidimensional Arrays as Properties in Class Files?
    By Trip in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-26-2005, 02:05 PM
  8. [SOLVED] user form & control properties
    By Mike Molyneaux in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2005, 04:41 PM

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