+ Reply to Thread
Results 1 to 2 of 2

Update many text boxes at once dynamically

Hybrid View

  1. #1
    Registered User
    Join Date
    07-02-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    1

    Update many text boxes at once dynamically

    Hi guys,
    I've been struggling around for about 2 hours now with no luck, I'm sure this is easy but could someone please spare me from throwing my laptop out the window!

    I have lots of text boxes that are named similarly but with different numbers at the end... I'd like to update all of them at the same time. I've tried Me.Controls in a loop but kept getting error messages. It doesn't seem to like it if the name is created "on the fly" with some sort of "DocName" & CStr(i). At the moment I'm resorting to this:

    DocName1.Value = Doc(1)
    DocRev1.Value = DocRev(1)
    DocNewRev1.Value = DocNewRev(1)
    DocName2.Value = Doc(2)
    DocRev2.Value = DocRev(2)
    DocNewRev2.Value = DocNewRev(2)

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Update many text boxes at once dynamically

    Hi

    I do this regularly with userforms and have no issues.

    This is the code I use:

    
    For Count = 1 To 66
     Me.Controls("Textbox" & Count).Text = Cells(1, Count).Value
    Next
    I am reading from a specific row in this version

+ 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. Dynamically create and Place Controls such as CheckBoxes,Text-Boxes in a UserForm
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 35
    Last Post: 05-11-2011, 11:34 AM
  2. Update Links in all text boxes
    By agentred in forum Word Programming / VBA / Macros
    Replies: 0
    Last Post: 05-27-2010, 10:50 AM
  3. Replies: 2
    Last Post: 02-19-2010, 03:55 PM
  4. [SOLVED] Dynamically Add Combo Boxes
    By AP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2005, 08:05 PM
  5. Copy drop down boxes and associate to cells dynamically in excel
    By Debra Dalgleish in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04: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