Results 1 to 2 of 2

Values in a Listbox onto a new row

Threaded View

  1. #1
    Registered User
    Join Date
    09-11-2013
    Location
    Edinburgh
    MS-Off Ver
    Excel 2010
    Posts
    3

    Values in a Listbox onto a new row

    Hi,

    I'm fairly new to Excel VB. I have a userform and I want the user to input values into 3 boxes press an add button and then it adds it to a Listbox.

    This is working fine for 1 line of data, but when I try to put a 2nd line of data it overwrites the first.

    Here is the code I have at the moment:

    Private Sub CommandButton1_Click()
    With Me.ListView1
    Me.ListView1.ColumnCount = 3
    Me.ListView1.ColumnWidths = "80;82;75"
    .AddItem
    .List(0, 0) = txtEmployeeContribution
    .List(0, 1) = txtCompanyContribution
    .List(0, 2) = txtTotal
    frmPID.txtTotal.Value = ""
    frmPID.txtCompanyContribution.Value = ""
    frmPID.txtEmployeeContribution.Value = ""
    End With
       
    End Sub
    Can anybody help me with this.

    Thanks
    Last edited by Fotis1991; 09-13-2013 at 06:50 AM. Reason: added code tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] excel vba filter values to listbox from combobox and save edit values in textbox
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2013, 08:42 AM
  2. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM
  3. Listbox of Values
    By bblesse in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2012, 04:17 AM
  4. Userform's listbox values depending on values on certain matrix
    By Juhanen II in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-19-2008, 08:01 AM
  5. Fill values into a listbox matching selected values from a combobox
    By Jon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2005, 01:06 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