+ Reply to Thread
Results 1 to 17 of 17

Edit/Update list from userform (auto alphabetized)

  1. #1
    Forum Contributor
    Join Date
    09-09-2009
    Location
    Columbus. Ohio
    MS-Off Ver
    Excel 2000
    Posts
    199

    Edit/Update list from userform (auto alphabetized)

    As the title suggests I have a sheet that creates a list of columns that may need to be updated or edited as necessary. Column A is a list of names that are alphabetized automaticaly from column D, so any change in column D would need to be reflected in column A. The attached sheet will (I hope) make things clearer.

    Thanks

    Jim O
    Attached Files Attached Files
    Last edited by Jogier505; 12-02-2009 at 09:36 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Edit/Update list from userform (auto alphabetized)

    Hi

    Sorting updated data:
    As you are using an event to sort the data in column A, why not add an instruction to copy the data from column D into column A before the sort? That way you (a) don't have to add the data to both columns, and (b) when you have data in column D updated, it will be selected and sorted.

    Updating Data:
    Your form really only has the option to add new data, or close. Are you requesting that your form is enhanced to have an update facility?

    rylo

  3. #3
    Forum Contributor
    Join Date
    09-09-2009
    Location
    Columbus. Ohio
    MS-Off Ver
    Excel 2000
    Posts
    199

    Re: Edit/Update list from userform (auto alphabetized)

    rylo,

    This sheet is part of a game pool, and the names are people who have entered. My thinking on this was that since the names are not entered at the same time and not everyone would pay their entry fee at the same time I needed a way to track and update as necessary. The plan as I see it is that as names come in they are entered into column "D". If the entrant has paid their fee, supplied an email address and given a tie breaker score that would be entered as well at that time. For the entries who pay later or supply information later I need a way to update that.

    The numbers in column "C" are used as a reference for a list of entries not payed and the letters in column "E" are for a column lookup elsewhere in the spreadsheet.

    Their may be 50 to 60 or more entrants and column "A" is alphebetized to make scrolling down the list easier.

    My thinking was that if a correction in spelling from column "D" needed to be made it would need to be reflected in column "A" or the lookup (see dropdown box in the green cell) would not work.

    It may be that that will create too many problems in which case just being able to edit/update columns "F", "G", and "H" would be fine.

    I am not very savy in the ways of VBA and any assistance would be a big plus.

    Thanks for your response.

    Jim O

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Edit/Update list from userform (auto alphabetized)

    Jim

    If you change your change event to
    Please Login or Register  to view this content.
    then changes made to column D will be reflected in column A.

    Your form only has one option - add a new entry.

    Do you want to have 2 different forms - one for add new entry, second for amend existing entry? Or do you want to have one form with 2 different options - add new or update?

    rylo

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Edit/Update list from userform (auto alphabetized)

    Hello Jogier505,

    I have revised your User Form and code to do what you asked. Column "A" has now been eliminated because the entries are now sorted when the user form opens, a new name is added, or a name is deleted. TextBox1 has been replaced by ComboBox1. This allows the user to either start typing in a name or select a name using the drop down.

    Column "B" no longer contains any formulae. This column is filled automatically by the macro whenever the data changes. The formulae in column "E" remain intact.

    Since you are opening the UserForm as non modal, I have added a code module to make the User Form act and look like a standard window. I have attached a jpg so you can see what the new form it looks like. The attached workbook contains all the changes.

    User Form Code
    Please Login or Register  to view this content.
    Clear Player Data Macro
    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  6. #6
    Forum Contributor
    Join Date
    09-09-2009
    Location
    Columbus. Ohio
    MS-Off Ver
    Excel 2000
    Posts
    199

    Re: Edit/Update list from userform (auto alphabetized)

    Leith,

    That is what I was hoping to achive. However I have found a few minor glitches.

    1. It will not allow me to edit an existing name. It will only accept a new entry.

    2. When a name is added or an entry is updated the text boxes and check box do not clear. so if you are not careful the next entry will have the same data.

    3. I need to limit the range when deleting an entry to columns C thru H not the entire row.

    That aside it is beautiful.

    Jim O

  7. #7
    Forum Contributor
    Join Date
    09-09-2009
    Location
    Columbus. Ohio
    MS-Off Ver
    Excel 2000
    Posts
    199

    Re: Edit/Update list from userform (auto alphabetized)

    I was looking at the application further and realized I probably need a list in column A and D.

    Column D and the column reference E are used to find data in 5 other sheets that are posted and locked into that reference. If column D keeps changing alphabeticaly each time a new name is entered it changes the column reference as well and will cause a great deal of confusion as the references will not be valid.

    Using combination of rylo's and Leith's code seems like the best way. This sheet just evolved and has grown since I started it last spring. I would have set it up differently now if I knew then what I know now, but hind-site is a wonderful thing.

    I'll keep you posted.

    Jim O

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Edit/Update list from userform (auto alphabetized)

    Hello Jim,

    I am not sure why you can edit an existing entry. In Excel 2003 it works with no problems. I see you are using Excel 2000, so I'll run it under Excel 2000 and check if there any problems due to different Excel versions.

    The rows are limited to the cells you specified. When it deletes it deletes only the cells in those columns for that row then shifts the data up. Using Formulas is not a good idea when creating a database. Because the data will be moved around and modified, formulas more often that not will cause you a lot of headaches because of broken references. Whenever you plan to create and automate a database, you should seek advice on the best way to approach it. I will look at the code closer for errors and correct any I find.

    Addendum: I ran the workbook using Excel 2000 with no problems.
    Last edited by Leith Ross; 12-02-2009 at 01:58 AM. Reason: Added comment

  9. #9
    Forum Contributor
    Join Date
    09-09-2009
    Location
    Columbus. Ohio
    MS-Off Ver
    Excel 2000
    Posts
    199

    Re: Edit/Update list from userform (auto alphabetized)

    Leith,

    I added a sheet to help clairify the relation between columns A, D and E. It has a similar function to the six other pages that the name and column lookup (the green cells) are linked to. I added "rolo's" code to have column A, update with any change to column D.

    I also changed the form but not all of it is funcitional. I am not sure of the code to have the combo box lookup the data and populate the text boxes. If the combo will "Find" a name and populate the text boxes can a "Save Changes" button complete the operation?

    The delete entry function is probably not necessary.

    Getting closer.

    Jim O
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Edit/Update list from userform (auto alphabetized)

    Jim

    Here's a bit more for you.

    1) Change the formula for PlayerName to
    Please Login or Register  to view this content.
    2) In the form, right click the combobox, properties, and insert playername in the rowsource properties.
    3) Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    4) Change the other code as below

    Please Login or Register  to view this content.
    See how that goes.

    rylo

  11. #11
    Forum Contributor
    Join Date
    09-09-2009
    Location
    Columbus. Ohio
    MS-Off Ver
    Excel 2000
    Posts
    199

    Re: Edit/Update list from userform (auto alphabetized)

    rylo and Leith,

    Thank you both very much for your time and effort. This site is just teriffic!

    That appears to get the job done.

    Again Thanks.

    Jim O

  12. #12
    Forum Contributor
    Join Date
    09-09-2009
    Location
    Columbus. Ohio
    MS-Off Ver
    Excel 2000
    Posts
    199

    Re: Edit/Update list from userform (auto alphabetized)

    For some reason the code is giving me a Run Time Error 1004 when I try to add a new name. I can edit an existing name but I cannot add a new one. The code line below is highlighted in yellow.


    Please Login or Register  to view this content.

    Jim O

    I have added the sheet and the code were the error occurs.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Jogier505; 12-03-2009 at 12:14 PM. Reason: To add more information.

  13. #13
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Edit/Update list from userform (auto alphabetized)

    Hi

    Why are you trying to add a formula to column D? Change the code to
    Please Login or Register  to view this content.
    then delete out the commented row. You only need to add the new entry to column D, as it will automatically be added to column A, and the defined name will automatically cover the additional item.

    rylo

  14. #14
    Forum Contributor
    Join Date
    09-09-2009
    Location
    Columbus. Ohio
    MS-Off Ver
    Excel 2000
    Posts
    199

    Re: Edit/Update list from userform (auto alphabetized)

    rylo,

    Thanks, I have added the change to the sample and it is working now. However I tried to add the changes to my actual worksheet and I keep getting a Run-time error '1004': Unable to get the Match property of the WorksheetFunction class, and the row that is highlighted is;

    DataRow = WorksheetFunction.Match(ComboBox1.Value, Range("D:D"), 0)

    I tried to upload a copy of the worksheet but for some reason the upload keeps failing. As it is getting late here I will fuss with it tomorrow, I may have to recreate the sheet from scratch.

    I will keep you posted.

    Jim O

  15. #15
    Forum Contributor
    Join Date
    09-09-2009
    Location
    Columbus. Ohio
    MS-Off Ver
    Excel 2000
    Posts
    199

    Re: Edit/Update list from userform (auto alphabetized)

    I think I have figured out what the problem is but I don't have any clue how to fix it.

    This project has gone through many changes over its creation and now I have run into a conflict. The attachment I hope will make things clearer.

    In the file I tried to upload yesterday I had deleted columns A-F on the data entry page and that was giving me the run time error.

    Jim O
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Edit/Update list from userform (auto alphabetized)

    Hi

    Problem is caused by moving the button to another sheet, and then not specifically nominating the sheet that has to be actioned. Normally in a situation like this, the button is on the sheet that you want to action, so you don't need to specifically reference a sheet as it will just work on the active sheet.

    See how this goes.

    Please Login or Register  to view this content.
    rylo

  17. #17
    Forum Contributor
    Join Date
    09-09-2009
    Location
    Columbus. Ohio
    MS-Off Ver
    Excel 2000
    Posts
    199

    Re: Edit/Update list from userform (auto alphabetized)

    I had figured out that it was not finding the correct sheet but had no way to rectify th situation. I was able to patch something close by adding a reference to the sheet in the code, but it presented other issues.

    Your soluition is much cleaner and I thank you for your time.

    Jim O

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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