+ Reply to Thread
Results 1 to 1 of 1

Run time error 424 Object required

  1. #1
    Registered User
    Join Date
    06-07-2013
    Location
    Warsaw
    MS-Off Ver
    Excel 2007
    Posts
    19

    Run time error 424 Object required

    Hi everybody!

    I'm a self learner in case of VBA.
    Actually I'm starting with it.
    Could you please help me with this code?

    I don't know why I'm getting a error message if I choose a second (checkbox2)??
    If I choose the first checkbox1 it woprks.

    Private Sub Checkbox1_Click()
    Dim emptyRow As String
    If usfdoc.CheckBox1.Value = True Then
    Sheet2.Activate
    emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
    Cells(emptyRow, 1).Value = "Company1"
    End If

    If usfdoc.CheckBox1.Value = True Then
    Sheet2.Activate
    emptyRow = WorksheetFunction.CountA(Range("B:B")) + 1
    Cells(emptyRow, 2).Value = "OPE contract"
    End If


    If usfdoc.CheckBox1.Value = True Then
    Sheet2.Activate
    emptyRow = WorksheetFunction.CountA(Range("D:D")) + 1
    Cells(emptyRow, 4).Value = "Hire"
    End If
    usfOPE.Show
    End Sub

    Private Sub CheckBox2_Click()
    ' Enters the company name, document name, WC data in to a specific cell
    Dim emptyRow As String
    If usfdoc.CheckBox2.Value = True Then
    Sheet2.Activate
    emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
    Cells(emptyRow, 1).Value = "Company1"
    End If

    If usfdoc.CheckBox2.Value = True Then
    Sheet2.Activate
    emptyRow = WorksheetFunction.CountA(Range("B:B")) + 1
    Cells(emptyRow, 2).Value = "FTC contract"
    End If

    If usfdoc.CheckBox2.Value = True Then
    Sheet2.Activate
    emptyRow = WorksheetFunction.CountA(Range("D:D")) + 1
    Cells(emptyRow, 4).Value = "Hire"
    End If
    usfFTC.Show
    End Sub

    Thank you for your help,

    Laik2013
    Last edited by Laik2013; 06-13-2013 at 02:27 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.6.0 RC 1