+ Reply to Thread
Results 1 to 5 of 5

refer to Textbox using a loop

  1. #1
    Forum Contributor
    Join Date
    06-24-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    188

    refer to Textbox using a loop

    Good morning,

    I have 30 Textboxes and want to refer to each as follows:

    Please Login or Register  to view this content.
    Would you know how to refer to textbox objects without hardcoding Textbox1.value = "blabla", Textbox2.value = "blabla2" etc...

    if you have an idea, it would be very helpful! Thank you in advance for your time.

    -Phil

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

    Re: refer to Textbox using a loop

    Maybe:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-24-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    188

    Re: refer to Textbox using a loop

    Thanks Kyle,

    I have never used Me. something, how can we use it.

    Thanks you so much for your quick reply.

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

    Re: refer to Textbox using a loop

    It is used in the object that you are executing the code from. So in this case it assumes that the code is in a userform and relates to the textboxes on the userform, excluding it would be just as valid, just a little less explicit:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-24-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    188

    Re: refer to Textbox using a loop

    thank you for your solutions and the explanation.

+ 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. VBA, Userform, Textbox: Refer to TextBox Name as a Variable
    By Brianandstewie in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 07-09-2013, 05:49 PM
  2. [SOLVED] refer an activex textbox
    By pankajy18 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-04-2013, 01:24 PM
  3. Excel VBA: Can I refer to a textbox as a variable?
    By BigBas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2013, 06:18 AM
  4. Can you set a name to refer to the value of a textbox?
    By JasonBarnes in forum Excel General
    Replies: 1
    Last Post: 02-04-2011, 11:54 AM
  5. to refer to a textbox from a module
    By kmlprtsngh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-28-2010, 03:05 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