Results 1 to 3 of 3

Defining a sheet from a combobox to determine which sheet the info is added to

Threaded View

  1. #1
    Registered User
    Join Date
    03-15-2013
    Location
    Annan, Scotland
    MS-Off Ver
    2010
    Posts
    17

    Defining a sheet from a combobox to determine which sheet the info is added to

    i was currently using

    Private Sub cmbAdd_Click()
        'next empty cell in column A
        Set c = Range("a65536").End(xlUp).Offset(1, 0)
        Application.ScreenUpdating = False    'speed up, hide task
        'write userform entries to database
        With Me
            c.Value = .ComboBox1.Value 'column one is first name
            c.Offset(0, 1).Value = .TextBox3.Value 'column 3 is department
            ClearControls 'clear the form
        End With
        Application.ScreenUpdating = True 'updatescreen
    End Sub
    which was fine for a while however after some months its getting a very large amount of data so i want to have a seperate sheet - eventually possibly a seperate workbook for each month and at the top of my form a combobox with months so rather than just compiling a large list in one place it will add the data to the sheet specified..

    Set c=Range(combobox1.value!a65536... or something along those lines but im not sure how id do it? cant seem to find much on google..

    Any help would be great


    Solved as --- Set c = Worksheets(ComboBox1.Value).Range("a65536").End(xlUp).Offset(1, 0)
    Last edited by arlu1201; 06-22-2013 at 06:50 AM.

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