+ Reply to Thread
Results 1 to 6 of 6

Loop to refresh user form TextBoxes

  1. #1
    Registered User
    Join Date
    08-26-2017
    Location
    Cannes
    MS-Off Ver
    Office 2010
    Posts
    3

    Post Loop to refresh user form TextBoxes

    Hello,

    I would like to use a FOR...NEXT loop to read 6 cells from an excel file and update six fields of my user form.

    It should perform this :
    - store in TextBoxDescription01 what it reads from cell A1"), then
    - store in TextBoxDescription02 what it reads from cell A2"), then
    - store in TextBoxDescription03 what it reads from cell A3"), etc....

    I am trying to use a loop that does not work:

    For x = 1 To 6
    UserForm1.TextBoxDescription0x = Sheets("Sheet1").Range("A" & x)
    Next x


    It does not like my "x" after TextBoxDescription0. My purpose is that it generates automatically TextBoxDescription01, TexboxDescription02, etc.

    What am I doing wrong? I tried alternates like TextBoxDescription0 & x, etc... But without success...

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Loop to refresh user form TextBoxes

    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    08-26-2017
    Location
    Cannes
    MS-Off Ver
    Office 2010
    Posts
    3

    Re: Loop to refresh user form TextBoxes

    Thank you, I am going to try this code.

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Loop to refresh user form TextBoxes

    You're welcome. Take your time

  5. #5
    Registered User
    Join Date
    08-26-2017
    Location
    Cannes
    MS-Off Ver
    Office 2010
    Posts
    3

    Re: Loop to refresh user form TextBoxes

    Excellent, it works great! Thanks for your help.

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Loop to refresh user form TextBoxes

    You're welcome. Glad I can offer some help
    Please mark the thread as solved

+ 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. Given a User Form with 256 textboxes - how can I access a selected one?
    By joebbb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2015, 11:17 AM
  2. Sum 2 textboxes on user form to 3rd when data entered
    By edopts in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-17-2014, 04:04 PM
  3. Copy data from previous row into new row IF user form textboxes are not populated
    By syl127 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-03-2014, 10:35 AM
  4. Can't leave empty date textboxes on user form when using CDate
    By JTResearch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2013, 11:37 AM
  5. grouping multiple textboxes on a user form
    By Obfuscated in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-27-2013, 05:31 PM
  6. Can a command button make textboxes dissapear from a user form
    By shakey775 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-19-2012, 03:01 AM
  7. Formatting alignment in User Form Textboxes
    By ChemistB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2011, 01:06 PM

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