+ Reply to Thread
Results 1 to 3 of 3

How do you append Loop Index to a Label Object?

  1. #1
    Registered User
    Join Date
    12-24-2014
    Location
    Texas, United States
    MS-Off Ver
    Office 2013
    Posts
    2

    How do you append Loop Index to a Label Object?

    Hello!

    I have many labels on my userform that become visible if there is an error. (ErrorLabel1, ErrorLabel2, ErrorLabel3.... etc). If any are visible, I want to disable my submit button.

    I created a FOR LOOP. I tried using "i" to distinguish between each ErrorLabel. However, the compiler doesn't recognize this as a Label Object. Is it possible to create a string and then convert the string to a label? I'm not sure how to do that though... Below is my latest attempt. Many thanks in advance for your help!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: How do you append Loop Index to a Label Object?


    Hi :

    Use Controls collection : If Controls("ErrorLabel" & i).Visible …

  3. #3
    Registered User
    Join Date
    12-24-2014
    Location
    Texas, United States
    MS-Off Ver
    Office 2013
    Posts
    2

    Re: How do you append Loop Index to a Label Object?

    Fantastic!! Merci beaucoup!!

+ 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. append the corect data using vlookup or index
    By exceledge in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-20-2013, 06:51 PM
  2. worksheet object as string - loop statement in worksheet index
    By ag273n in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-20-2013, 12:27 PM
  3. Loop and append
    By DJP1339 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2011, 05:36 PM
  4. label overflow control, append "..."
    By lolelner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-07-2010, 09:58 AM
  5. [SOLVED] Passing a Label object to another procedure
    By derobin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-16-2006, 05:45 AM

Tags for this Thread

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