+ Reply to Thread
Results 1 to 3 of 3

Name.Object (Error Object Required)

  1. #1
    Registered User
    Join Date
    09-10-2010
    Location
    N/A
    MS-Off Ver
    Excel 2007
    Posts
    55

    Name.Object (Error Object Required)

    Here is my function code that prompts a user when they submit a form and have a specific checkbox marked. It returns as error "object required" on the activecell.offset line when i add Name.Caption in the inputbox. I want this function to work for all checkboxes and use the Caption value in the checkbox property.

    Public Function CheckBox(Name As Variant)

    Static Counter As Integer

    Counter = Counter + 1

    If Name = True Then

    Name = MsgBox("Do you want a specific" & Chr(32) & Name.Caption & "?", vbYesNo)

    If Name = vbYes Then

    ActiveCell.Offset(0, Counter).Value = InputBox("Enter" & Chr(32) & Name.Caption, "E.g." & Name.Caption)

    End If
    End If


    End Function

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Name.Object (Error Object Required)

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-10-2010
    Location
    N/A
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Name.Caption (Error Object Required)

    Sorry about that, I should have taken the time to read the rules. The error is "Run time error 424, object required. When i try to debug it brings me to line 7. The error comes when i add "...& Name.Caption & " (without the quotes).


    Please Login or Register  to view this content.

+ 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