+ Reply to Thread
Results 1 to 5 of 5

Thread: Using Many Userforms to record data on worksheet

  1. #1
    Forum Contributor
    Join Date
    10-28-2011
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    114

    Question Using Many Userforms to record data on worksheet

    Hi all

    I have around 35userforms based on a service category and the information is to be stored in a worksheet - 'Service_Delivery'.

    I have created a template for where the information is to be stored on 'Service Delivery' but the total number of rows is more than 5000.

    I was wondering whether there could be an easier way to code out where the information is to be stored. – such as look for site ID AND service category then….

    I have attached an example showing the ‘Security’ form and where the data should be displayed.

    Many Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2007
    Posts
    1,879

    Re: Using Many Userforms to record data on worksheet

    You should definitely store the data for each form on a separate sheet. You should have a separate sheet for Service1, Service2, Security, etc. In my opinion, it is also more intuitive to put the headers on the top row and the records on subsequent rows instead of puting the headers in the first column and the data in subsequent columns.

    If you care to learn, Access is a much better tool for this type of problem.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Forum Contributor
    Join Date
    10-28-2011
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: Using Many Userforms to record data on worksheet

    I know the way the data is stored is not the best way but I really wanted to avoid 35+ tabs for worksheets. On my actual document I have search boxes and filters so it's not much of a problem.

  4. #4
    Forum Contributor
    Join Date
    10-28-2011
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    114

    Re: Using Many Userforms to record data on worksheet

    Any ideas?

  5. #5
    Forum Guru snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,151

    Re: Using Many Userforms to record data on worksheet

    I don't have the impression you need many userforms.
    It looks as if many data are recurring.
    It's common practice to consider columns to be 'fields'.
    You set up the sheet the other way around.
    I would start restructuring.
    You won't need many columns, because now you entered all the options too.

    In the userform you can reduce the code by rnaming some controls so that the inituialize event can be reduced to:

    Private Sub UserForm_Initialize()
      ComboBox1.List = Split("Manned Guarding|Mobile Patrols|Reception Services|Remote Monitoring|CCTV Monitoring|Key Holding", "|")
      For j = 2 To 7
        Me("Combobox" & j).List = ComboBox1.List
      Next
          
      ComboBox8.List = Split("Fixed Price Contract|Fixed Price Contract and Variation Pass Through|Passthrough Costs", "|")
       
      ComboBox10.List = Split("Security Supervisor|Security Manager|Security Officer", "|")
      For j = 11 To 15
         Me("combobox" & j).List = ComboBox10.List
      Next
    End Sub
    Last edited by snb; 11-18-2011 at 05:14 AM.



+ 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.2.0