Results 1 to 7 of 7

Populate Userform with values from table

Threaded View

LKERN Populate Userform with values... 03-10-2020, 06:37 PM
mehmetcik Re: Populate Userform with... 03-11-2020, 07:29 AM
LKERN Re: Populate Userform with... 03-11-2020, 10:03 AM
mehmetcik Re: Populate Userform with... 03-11-2020, 10:33 AM
LKERN Re: Populate Userform with... 03-11-2020, 01:16 PM
LKERN Re: Populate Userform with... 03-12-2020, 08:41 AM
LKERN Re: Populate Userform with... 03-12-2020, 09:35 AM
  1. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Populate Userform with values from table

    Sorry.

    I updated that afterwards. Upload a new sample from Post Number 2.

    Try this:
    
        For Each ctl In Me.Controls
    
    On Error Resume Next
            Select Case TypeName(ctl)
                Case "TextBox"
                    ctl.Value = ""
                Case "ComboBox", "ListBox"
                    ctl.ListIndex = -1
                    ctl.value =""
            End Select
        Next ctl
    On Error Goto 0
    Alternatively:

    Create a Change Flag. Set Your Emtry to an empty row and load a blank entry.

    Global CF as Boolean

    
    Sub ClearScreen()
    CF = True
    Entry = Cells(rows.count,1).End(xlUp).Row+2
    LoadEnty
    End Sub
    
    Sub LoadEntry()
    On Error Resume Next
    'CF is the flag to stop macros running when a Control is modified.  Example Below
    CF = True
    
    LoadArray = Range((Entry, "A"),(Entry, "BQ")).value
    
    For Count =3 To 69
          Me.Controls("CheckBox" & Count).Value = LoadArray(Count)
          Me.Controls("ComboBox" & Count).Value = LoadArray(Count)
          Me.Controls("ListBox" & Count).Value = LoadArray(Count)
          Me.Controls("Label" & Count).Caption = LoadArray(Count)
          Me.Controls("TextBox" & Count).Value = LoadArray(Count)
          Me.Controls("SpinButton" & Count).Value = LoadArray(Count)
    Next
    
    CF = False
    On Error GoTo 0
    End Sub


    '*************************************************************************************************
    Last edited by mehmetcik; 03-11-2020 at 01:38 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Populate UserForm List with values from an Array
    By plans in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2019, 10:15 AM
  2. Populate new row in table from a form (not userform) on another worksheet
    By joeystraw in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-01-2018, 10:59 AM
  3. [SOLVED] populate userform with data from pivot table
    By Mathijs3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2016, 10:30 AM
  4. Populate userform from row values based on combobox
    By robertogavilan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-20-2014, 06:32 PM
  5. VLookup Excel table to populate combobox in userform
    By trecie13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2013, 02:17 PM
  6. Replies: 1
    Last Post: 11-12-2011, 05:38 PM
  7. Populate Excel table with userform data
    By waspandbee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-21-2010, 09:34 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