+ Reply to Thread
Results 1 to 25 of 25

Userform Edit function help Please

  1. #1
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Userform Edit function help Please

    Hi all,
    I have been greatly helped by Fotis1991.
    This question is an extension of my previous question.
    I should have made a fresh thread. Apology for the mistake.
    It will not happen again.

    I need help in the following aspect please.

    The code works fine, only thing that it does not edit existing records.
    I have attached so far created workbook.
    It has 3 sheets named 'New' , 'Inuse' and 'Finished' + 1 userform with two textboxes.

    It does retrieve the existing records from sheets as selected... in list box.
    However does not edit existing records . It only creates new record.
    I am aware that it will need a row reference to replace existing records, but I dont know how to do it.

    Once again help by Fotis1991 is greatly appriciated.
    Please help.

    Many thanks
    Kind regards
    Attached Files Attached Files

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Userform Edit function help Please

    This question is an extension of my previous question.
    It would have been nice to have a link back to that.

    Something like this.
    Attached Files Attached Files
    Last edited by Tinbendr; 04-15-2014 at 09:53 AM.
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi Tinbendr,
    Many thanks for your kind help.
    Example is simple and understood.
    I would really appriciate if you can help in my original sample file with a code so that everything will be in one place and easy to understand for me.
    Kind regards

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Userform Edit function help Please

    You'll have to be more specific.

    You asked to edit a record. How are you going to edit it if you don't bring into the userform?

  5. #5
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi again,
    I agree with you.
    The userform sample, we are successful in getting data into the userform.
    However when I edit it & submit, it goes as a new entry rather than edited version of existing entry.
    Please refer my sample book userform.xlsm
    Thanks a lot again.
    Please help
    I have spent many sleepless nights to get this right, but not yet successful.
    Thanks

  6. #6
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi
    Please Login or Register  to view this content.
    Please refer to see history.
    Many thanks

  7. #7
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi ,
    Do you need any more information please
    Kind regards

  8. #8
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Userform Edit function help Please

    In your example, yes, but more is required to edit a record, hence my WB.

    You are either going to have to search for the record in question, or store the record location when you load the combobox/listvox.

    Since your data isn't unique enough, I took the second approach.

    Looking at Folis example, his commandbutton5 event doesn't look for the record, but rather stores it at the next empty row. (Which he states.)

    Would you like me to adapt my code to the workbook in the other thread?

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Userform Edit function help Please

    Quote Originally Posted by Tinbendr View Post
    I
    Looking at Folis example, his commandbutton5 ...
    Fotis ..!!!
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  10. #10
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Userform Edit function help Please

    Sorry, it's the middle of the night here and I'm up with a head cold! :P

  11. #11
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Userform Edit function help Please

    Never mind! I was just joking!

    ..Would you like me to adapt my code to the workbook in the other thread?
    I believe that this is what OP wants.

  12. #12
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi Friends,
    I am bit confused.
    What do we do next now to find solution.
    Please advice.
    Kind regards

  13. #13
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi Foits1991 & Tinbendr,
    Ideally combining codes of Fotis1991 ( Get data in list box)
    And Tinbendr's code to edit them will be ideal.

    What happens if we have 27 columns to deal with.
    Tinbender's solution is really good but is limited to one column or so to say one textbox only.
    Therefore recalling records in listbox and then selecting them by clicking , will populate userform.
    This then can be edited

    Hope for the best
    Kind regards
    This is what I am looking for

  14. #14
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Userform Edit function help Please

    What happens if we have 27 columns to deal with.
    You're going to have to decide which format you want. Both threads have different layouts. Now your talking about 27 columns.

    What represents your actual data?

    27 Columns on one sheet?

    27 Sheets with one list.

    27 columns on 27 sheets?

    Do you want to pick sheet first, then record?

    Do you want to load all records from all sheets and all columns into one list to pick from?

    View/edit the record in really a minor lookup. Deciding on the cascade of information is more important.

  15. #15
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi,
    I have modified the code of Tinbendr,
    And tried to adapt concept of Fotis1991.
    Few things work few don't.
    Needs some fine tuning.
    Please help
    Kind regards
    Attached Files Attached Files

  16. #16
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Userform Edit function help Please

    I am not a programmer so i am not 100% sure for this, but:

    I believe that you can not use both of our suggestions because the logic that we use is different.

    To say the true, when i saw your last example sheet, i comfused !!

    So i have something in my mind for solving this using the example of your previous thread and not last one(which i don't understand), but as i have an important meeting in half an hour, i'll be able to see it tomorrow morning(it's 15:pm-here).

  17. #17
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi Tinbendr,
    Thanks
    Actual data is either a text or number ( very simple)
    Yes 27 columns in one sheet.
    want to load all records from sheet1 and columns A,B,C,D to list to pick from. ( And it loads all records in respective textboxes )
    So I click on command button to open form, then pick record from list.
    Amend it and save it.
    OR create new record

    Greatful
    Kind regards

  18. #18
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    OK sir.
    Will do

  19. #19
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Userform Edit function help Please

    OK, try this version and see if we're close.
    Attached Files Attached Files

  20. #20
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi Tinbendr,
    Yes indeed. Very well done. Very very close indeed
    Still there is a compiling error for the command button code happens:
    Please Login or Register  to view this content.

  21. #21
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Userform Edit function help Please

    Where's the error? Runs find on my machine.

  22. #22
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi
    The code highlighted states ' end with without with,
    I tried to understand and code looks ok
    I don't know what's the issue
    Many thanks
    Kind regards
    😀

  23. #23
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Userform Edit function help Please

    Well, maybe it doesn't run fine after all.

    I have the Next amd the End With switched.

    Change to
    Please Login or Register  to view this content.

  24. #24
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Hi Tinbndr,
    Very well tried Sir,
    Something is not right
    Now the following line gets highlighted.
    Please Login or Register  to view this content.


    I will certainly never give up.
    I will take ahead your great efforts to the right conclusion.
    May be I am using excel 2010 and certain codes may not work correctly I guess.
    I will get back to you.
    Once again very well done to you
    Kind regards

  25. #25
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Userform Edit function help Please

    Sorry,
    Tinbendr
    Name was incorrectly spelled.
    Apology

+ 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. Userform to edit macro?
    By mungel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-26-2011, 05:42 AM
  2. Userform search and edit function help
    By adjustermn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2010, 03:35 PM
  3. edit the existing userform
    By barishta in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-17-2009, 01:36 PM
  4. Userform to edit data
    By randolphoralph in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2008, 07:27 PM
  5. only edit from userform
    By mg_sv_r in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-17-2006, 09:10 AM

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