Results 1 to 16 of 16

Help With VBA Code to input use rform Data.

Threaded View

  1. #1
    Registered User
    Join Date
    01-23-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    81

    Help With VBA Code to input use rform Data.

    Hi guys & gals, I'm new here and also fairly new to VBA. I have a userform I want to use to fill in a table on a worksheet. I have the clear and Cancel buttons working fine but the submit form button is not working. Bellow is the code I have, your help is appriciated!
    Private Sub SubmitForm_Click()
    Dim emptyRow As Long
    
    'Make Sheet Log Current Active
    Worksheet(Log - Current).Activate
    
    'Determine Empty Row
    emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
    
    'Transfer Information
        'Text Boxes
    
    Cells(emptyRow, 22).Value = TextBox2
    Cells(emptyRow, 23).Value = TextBox3
    Cells(emptyRow, 26).Value = TextBox4
    Cells(emptyRow, 27).Value = TextBox5
    Cells(emptyRow, 29).Value = TextBox6
    Cells(emptyRow, 18).Value = DivisionListBox
    Cells(emptyRow, 19).Value = BusinessUnitListBox
    
    
        'Specialist Boxes
    If SpecialistCheckBox1.Value = True Then Cells(emptyRow, 2).Value = SpecialistCheckBox1.Caption
    
    If SpecialistCheckBox2.Value = True Then Cells(emptyRow, 2).Value = Cells(emptyRow, 2).Value & " " & SpecialistCheckBox2.Caption
    
    If SpecialistCheckBox3.Value = True Then Cells(emptyRow, 2).Value = Cells(emptyRow, 2).Value & " " & SpecialistCheckBox3.Caption
    
    If SpecialistCheckBox4.Value = True Then Cells(emptyRow, 2).Value = Cells(emptyRow, 2).Value & " " & SpecialistCheckBox4.Caption
    
        'Type of Change
    
    If HireBox.Value = True Then Cells(emptyRow, 2).Value = HireBox.Caption
    
    If RehireBox.Value = True Then Cells(emptyRow, 2).Value = Cells(emptyRow, 2).Value & " " & RehireBox.Caption
    
    If TransferBox.Value = True Then Cells(emptyRow, 2).Value = Cells(emptyRow, 2).Value & " " & TransferBox.Caption
    
    If PersonalChangeBox.Value = True Then Cells(emptyRow, 2).Value = Cells(emptyRow, 2).Value & " " & PersonalChangeBox.Caption
    
        'Plan Type
        
    If PlanBox1.Value = True Then Cells(emptyRow, 2).Value = PlanBox1.Caption
    
    If PlanBox2.Value = True Then Cells(emptyRow, 2).Value = Cells(emptyRow, 2).Value & " " & PlanBox2.Caption
    
    If PlanBox3.Value = True Then Cells(emptyRow, 2).Value = Cells(emptyRow, 2).Value & " " & PlanBox3.Caption
    
        'Hourly/Salaried
        
    If HourlyBox.Value = True Then Cells(emptyRow, 2).Value = HourlyBox.Caption
    
    If SalaryBox.Value = True Then Cells(emptyRow, 2).Value = Cells(emptyRow, 2).Value & " " & SalaryBox.Caption
    Else
    Cells(emptyRow, 3).Value = LogNumberBox1
    End If
    Cells(emptyRow, 24).Value = CommentsBox
    
    End Sub
    Thanks!
    Last edited by Invicta084; 01-23-2014 at 12:25 PM. Reason: Comply with rules

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 12-17-2013, 11:51 AM
  2. Replies: 1
    Last Post: 11-13-2013, 10:28 AM
  3. Replies: 2
    Last Post: 03-09-2013, 04:30 AM
  4. Code for email alerts from excel isn't working, wrong code possibly?
    By jessthorogood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 01:45 AM
  5. Replies: 0
    Last Post: 10-06-2006, 09:05 AM

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