Results 1 to 16 of 16

Populate Userform with items in a range so user can edit

Threaded View

  1. #1
    Forum Contributor
    Join Date
    11-15-2008
    Location
    Arizona
    MS-Off Ver
    Excel 2013
    Posts
    181

    Populate Userform with items in a range so user can edit

    I have a userform where users enter in items that will become their drop-down menus. The form works great!

    This is the code for that form:

    Private Sub ClientsSubmit_Click()
      Dim Address As String
      Dim Items() As String
      Dim Count As Integer
      
     
      Items = Split(Me.TextBox2.Value, vbCrLf)
      Count = UBound(Items) - LBound(Items) + 1
    
      With ThisWorkbook.Sheets("Lists")
        Address = .Range("Clients").Address
        .Range("Clients").ClearContents
        .Range(Address).Resize(Count, 1).Value = Application.Transpose(Items)
      End With
      
      Unload Me
      
      Call AlphabetizeClients
      
      MsgBox "Your repeat client list is now ready."
      Exit Sub
    
    End Sub
    However, now I want to add a different form where users can edit this drop-down list. So if they later want to delete or add an item they can. So I need the userform textbox to populate with their current drop-down list (each item on a separate line). Then a user can edit that textbox, and then when they click submit it will be the same previous code so it will create their newly edited list.

    This is my poor attempt:

    
    Private Sub EditClient_Initialize()
      
      With Me.EditClientbox
       .MultiLine = True
       .Value = Worksheets("Lists").Range("Clients")
      End With
      
    
    End Sub
    But when I click on the form, there is just a blank textbox. I knew this code wouldn't work. It was my poor attempt.

    I just need the form to already have their list in the textbox. And then they can modify that list any way they want, and then on submit, I will have the same code as before.

    Any ideas on how to get the textbox to show the content found in that range, each item showing on a different line.
    Last edited by dsrt16; 03-30-2018 at 11:40 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. edit in code for populate range of cell in list box and code for delete any items
    By mazan2010 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2017, 03:33 PM
  2. [SOLVED] Basic User list items , search, Edit from three sheets
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-15-2014, 06:52 AM
  3. Populate row value in userform textboxes, edit and save the changes back in sheet.
    By p_nayak268 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2013, 07:48 PM
  4. [SOLVED] Userform combobox used to populate and edit records does not recognize duplicate names
    By SLJones in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-07-2013, 05:56 PM
  5. [SOLVED] Populate cell values into 6 named text boxes in a userform then edit if required
    By How How in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-05-2013, 05:51 AM
  6. VBA edit listbox items on userform
    By Hilton1982 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2013, 03:51 AM
  7. Populate data in userform and edit
    By surajitbose in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-12-2012, 04:51 PM

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