Adding records to a multi-sheet database

Important Notice


Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

  • Hello,


    It's been a couple of years since I was last on here, but thought I'd come back before doing something rash, like throwing my system out the window.


    I am setting up a database in Excel for one of my businesses. This database has multiple worksheets, one for each business category.


    Basically, I am trying to design a simple userform that will allow me to add records to the registry. The userform contains three labels, two textboxes, a combobox, and two command buttons.


    The combobox is how I select the business category that the new entry needs to be entered in. What I am trying to do is when I enter the data on the form and select the category, then when I click the Add Record button, it will automatically go to the worksheet for that business category, find the next empty row and paste the data from the form into the appropriate cells.


    I would post a copy of the workbook except that it is quite large already (over 1MB). Any assistance the could be rendered would be most appreciated. Oh, also, not sure if you need to know, but I am using Excel 2003.

  • Re: Adding records to a multi-sheet database


    I had a bit of time on my hands so i created this for you





    to load the sheets into the combo


    Code
    Private Sub UserForm_Initialize()
    'add all the sheets in the workbook to the form combo
    Dim ws As Worksheet
    For Each ws In ThisWorkbook.Worksheets
        ComboBox1.AddItem ws.Name
    Next
    End Sub


    See attached eg file

  • Re: Adding records to a multi-sheet database


    My most sincere thanks for your assistance in this. You have saved me hours of work as a lot of what I am doing is getting information from a business registration site, and when I would paste from the site directly into a cell, it would inherit the hyperlink, which is what I didn't need nor want. Any given that I have just under 200 worksheets to work with so far, having to scroll through them all would have taken a great deal of time.


    So again, I thank you.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!