+ Reply to Thread
Results 1 to 2 of 2

Looking for some help with a userform

Hybrid View

  1. #1
    Registered User
    Join Date
    10-19-2010
    Location
    Arlington, WA
    MS-Off Ver
    Excel 2013
    Posts
    40

    Looking for some help with a userform

    Using Excel 2007.

    I attempted my first userform and am a near-noob when it comes to Visual Basic. I have the following code from the "submit" type button on my userform. When I run it, it enters the information just fine. However, I need each additional entry to populate on the next line down. Can anyone help me with that? Also, I can run this from the visual basic window, but how do I get the userform to show up as a macro (it doesn't show up in the list of macros)?

    Code:

    Private Sub AddNewEntry_Click()
    eRow = Sheet3.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    Cells(eRow, 1) = RosterBox.Text
    Cells(eRow, 2) = DateBox.Text
    Cells(eRow, 3) = ReasonBox.Text
    Cells(eRow, 4) = CommentBox.Text
    Cells(eRow, 5) = BeginTimeBox.Text
    Cells(eRow, 6) = EndTimeBox.Text

    End Sub

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Looking for some help with a userform

    A user form will not show up as a macro. You have to create a macro to show it, so for example:

    Sub Show_Form()
    UserForm1.Show 'whatever your user form is called
    End Sub
    As to why you are not able to populate the next row it could be a couple of things. Where is Sheet3 defined and what is it? Does RosterBox.Text always have a value when you go to populate? Is eRow calculating the lastrow properly each time you click the submit button?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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