+ Reply to Thread
Results 1 to 13 of 13

Userform: Add or Update are not working correctly

  1. #1
    Registered User
    Join Date
    11-14-2017
    Location
    Montreal, Canada
    MS-Off Ver
    Office 365
    Posts
    38

    Userform: Add or Update are not working correctly

    Hello,
    Many thanks in advance if someone could help me resolve this issue!

    The Userform data are not being added to the right column, something is not right...
    Column C, G, I, M, N, W, X, should be blank because of the formulas in these columns.

    Big thanks for your help!
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Userform: Add or Update are not working correctly

    .
    You are using an ARRAY to enter your data in the sheet columns. The data is populating one column next to the other, without indication (to Excel) where to place the data.

    Edit your macro so the data is being entered from the form in this manner (no array):

    (This is one way of reaching your goal)


    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-14-2017
    Location
    Montreal, Canada
    MS-Off Ver
    Office 365
    Posts
    38

    Re: Userform: Add or Update are not working correctly

    Thank you so much Logit!

    Was capable to update the "Add" part, but still having issue with the "Update" part, Could you please help me again?

    PS.
    Do you have by any chance a file with Userform options available?
    I have a Check Box button in this file and I am still trying to understand how it works.
    Thanks again!

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Userform: Add or Update are not working correctly

    Could just add the formula for those cells to your array. Something like below

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Userform: Add or Update are not working correctly

    .
    mike:

    I looked around for a solution using the ARRAY method and was not successful.

    Your suggestion as presented, would that encompass ALL the columns he is using or does the line of code need to be expanded to include all the textboxes by name ?

    ex: Rng.Rows(Rng.Rows.Count).Value = Array(TextBox0, txtName, "=Month(RC[-1])", TextBox2, TextBox3, TextBox4, TextBox5, TextBox6, TextBox7, TextBox8, TextBox9, TextBox10, TextBox11, TextBox12, TextBox13, ComboBox1, ComboBox2, ComboBox3)

    I'm still learning !

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Userform: Add or Update are not working correctly

    Hey Logit something like below. This is not correct but will give a general idea.

    Column C, G, I, M, N, W, X, should be blank because of the formulas in these columns.
    Please Login or Register  to view this content.
    Edit: Also don't see a Formula in Columns that OP is saying there is a formula.
    Ex: Columns G and I doesn't have a formula but Column H does. So I'm a little confused
    Last edited by mike7952; 11-24-2017 at 06:27 PM.

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Userform: Add or Update are not working correctly

    .
    Tks .........................

  8. #8
    Registered User
    Join Date
    11-14-2017
    Location
    Montreal, Canada
    MS-Off Ver
    Office 365
    Posts
    38

    Re: Userform: Add or Update are not working correctly

    Thanks you so much! Now, Add & Update are working with "Array", BIG Thanks!!

    Just a quick question before "SOLVED", do you have by any change the VBA code to copy/paste the table format to the new added row?
    Thanks again!

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Userform: Add or Update are not working correctly

    Quote Originally Posted by scoclu View Post
    Thanks you so much! Now, Add & Update are working with "Array", BIG Thanks!!

    Just a quick question before "SOLVED", do you have by any change the VBA code to copy/paste the table format to the new added row?
    Thanks again!
    Is the new data going to be added to the table or in the rows below like your example workbook?

  10. #10
    Registered User
    Join Date
    11-14-2017
    Location
    Montreal, Canada
    MS-Off Ver
    Office 365
    Posts
    38

    Re: Userform: Add or Update are not working correctly

    Would be added in the table, thanks!

  11. #11
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Userform: Add or Update are not working correctly

    Could use a sub like this

    Please Login or Register  to view this content.
    and pass your array like below

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    11-14-2017
    Location
    Montreal, Canada
    MS-Off Ver
    Office 365
    Posts
    38

    Re: Userform: Add or Update are not working correctly

    Perfect! Thanks for your help, really appreciated Mike!

  13. #13
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Userform: Add or Update are not working correctly

    Your Welcome

+ 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: 1
    Last Post: 08-30-2017, 02:32 AM
  2. [SOLVED] userform was able to retrieve data from a workbook and then update not working
    By natks78 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-03-2015, 03:58 AM
  3. [SOLVED] From a UserForm, Update data command button is not working
    By johnw993 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-05-2015, 06:55 PM
  4. [SOLVED] UserForm : Update List is not working : Solved by ( jaslake)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-23-2014, 12:59 AM
  5. Replies: 9
    Last Post: 03-08-2013, 11:50 AM
  6. Userform tabbing not working correctly
    By Khaos176 in forum Excel General
    Replies: 1
    Last Post: 03-12-2009, 01:11 AM
  7. Auto Update not working correctly...
    By Jim@HiTek in forum Excel General
    Replies: 2
    Last Post: 07-12-2007, 05:16 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