Closed Thread
Results 1 to 8 of 8

Add/edit/delete records userform

  1. #1
    Forum Contributor
    Join Date
    04-08-2009
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2003
    Posts
    228

    Add/edit/delete records userform

    Hi all,

    I was wondering if any of you knew of a good tutorial for creating a simple userform which adds, edits and deletes data from a workbook.

    Really I'm just after the code for how to view, edit and delete existing rows in a worksheet, but a good tutorial is probably easier to follow.

    Any ideas? Would be really appreciated.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Add/edit/delete records userform

    Hi

    this site should get you on track. There is explanation in the code itself

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Add/edit/delete records userform

    Hi,

    Does the following from MS give you a starter for 10

    http://support.microsoft.com/kb/161514

    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Contributor
    Join Date
    04-08-2009
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2003
    Posts
    228

    Re: Add/edit/delete records userform

    Thanks guys, I've had a good look through those. Very very close to what I'm after.

    Can you just take a look at the blank .xls I've attached so you can see what I'm after. Might make more sense that way...
    Attached Files Attached Files

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Add/edit/delete records userform

    There's another one here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Add/edit/delete records userform

    Hi,

    User forms certainly offer a very professional look and feel, but don't ignore standard Excel Functionality. My general rule with all things Excel is to use standard Excel tools first and only resort to VBA when necessary.

    For instance when I'm designing a system to add records to a database I generally design a data entry form on the worksheet, using data validation, conditional formatting, locked cells etc. as necessary and have the user enter data here. Then tucked away in a hidden row at the top of the sheet I have a row of cells that are in exactly the same order as my database. I link each of these cells to the relevant cell in the entry form, and then use a macro attached to an 'Add New Record' button which simply copies the hidden row of data and pastes it as values to the next available row on the database.

    For data deletion I provide a drop down cell which uses a dynamic list range name that uses a column of data on the database. Then a macro to find the value selected in the database and a delete row instruction. Similarly for editing a record you can find the record, populate the user form and then re-enter changed data. Obviously a test is needed in this case to check whether the record already exists and decide whether to add it or replace it.

    I use Excel functions to count the number of entries on a form and this allows you to determine whether the form has been fully completed and you can use this check in a macro to tell the user the form is not complete.

    I find this approach much simpler and more straightforward than designing VBA userforms and adding list/combo boxes and the like.

    HTH

  7. #7
    Registered User
    Join Date
    09-10-2018
    Location
    Mt Laurel, NJ
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Add/edit/delete records userform

    Hello
    Would you have a sample spreadsheet with add/edit records without using VBA
    Thank you

  8. #8
    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: Add/edit/delete records userform

    Unfortunately your post does not comply with Rule 4 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    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.

Closed 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