+ Reply to Thread
Results 1 to 3 of 3

Userform not adding data to correct place

Hybrid View

  1. #1
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Userform not adding data to correct place

    Hi

    I need the user form to add the data to the correct rows and columns on Invoice Data - at the moment the values are not pasting in the right columns and rows, also it's not adding it to the table as extra lines when it's full. Have a feeling it has to do with defined names in name manger the spacing specified for each defined name might be incorrect.

    also, there seems to be a #value error with Invoice Main for units 10,2,3 not sure whats going on there. Thought it was calculation cuz it had credit but there are others that have credit but they work.

    Thanks again for helping out.
    Attached Files Attached Files

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,957

    Re: Userform not adding data to correct place

    Not to sure which columns you want to be populated...
    Have a look at this old upload of yours...The above one has to many weird things going on...
    Private Sub cmdAdd_Click()
    Dim lUnit As Long, tblrow
    Dim Tbl As ListObject
    Set Tbl = Sheets("Invoice Main").ListObjects("InvoiceMain")
    lUnit = cboUnit.ListIndex
    
    If Trim(Me.cboUnit.Value) = "" Then
        MsgBox "Please enter a Unit ID"
        Me.cboUnit.SetFocus
      Exit Sub
    End If
    
    With Tbl
        .ListRows.Add
         tblrow = .ListRows.Count
        .DataBodyRange(RowIndex:=tblrow, columnindex:=1).Resize(, 4) = Array(cboUnit, cboUnit.List(lUnit, 1), _
        cboDescription, txtDate, txtAmt)
    End With
    
    cboUnit = ""
    cboDescription = ""
    txtDate.Value = Format(Date, "Medium Date")
    txtAmt.Value = 1
    cboUnit.SetFocus
    End Sub
    Attached Files Attached Files
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    06-21-2016
    Location
    Nowhere
    MS-Off Ver
    2010, 2016
    Posts
    79

    Re: Userform not adding data to correct place

    Hahhhahhahah i like weird - :P

    Thanks will have a look. Much appreciated

    Do you know why I'm getting the #value error on the Invoice Main for units 10,2,3?

+ 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. Replies: 15
    Last Post: 11-25-2014, 08:14 AM
  2. add in userform wont place data on another workbook
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-04-2014, 09:22 AM
  3. [SOLVED] Userform doesn't apply data in correct place! Please HELP!
    By afrabat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-24-2014, 04:21 PM
  4. [SOLVED] Code to place userform data into next empty row
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-11-2013, 01:06 PM
  5. Check that the date is correct on a Userform prior to adding to spreadsheet
    By LoneWolf3574 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-28-2013, 05:42 AM
  6. [SOLVED] Problems selecting correct data after filter is in place
    By DarthWire in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2013, 06:18 AM
  7. Userform finding next row to place data
    By BrianW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2006, 05:45 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