+ Reply to Thread
Results 1 to 9 of 9

Pesky "Object Required" error

  1. #1
    Registered User
    Join Date
    08-27-2014
    Location
    Albany, NY
    MS-Off Ver
    Office 2010
    Posts
    91

    Pesky "Object Required" error

    I am trying to determine what I call the "DefaultCell" of a given range, which is the upper left most cell of the range the user selects. When I run the selection through the code below for the second selection, I get the "Object required" error, and I can't target why. For the first range selection, its fine though.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Pesky "Object Required" error

    What's UserRanges?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    08-27-2014
    Location
    Albany, NY
    MS-Off Ver
    Office 2010
    Posts
    91

    Re: Pesky "Object Required" error

    Sorry, yeah that might be important. It is a collection of cells in a user selected range. There can be more than one collection.

    I am trying to set firstCell (dim range) to the upper left most cell of the selected UserRanges collection (i.e. UserRanges(1)) and set it as a "default" value so that if the user repeats the value, it signals that all the ranges the user wants to select, are selected.
    Last edited by Coleman34; 04-15-2015 at 04:28 PM.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Pesky "Object Required" error

    So is UserRanges something you've defined/declared elsewhere?

  5. #5
    Registered User
    Join Date
    08-27-2014
    Location
    Albany, NY
    MS-Off Ver
    Office 2010
    Posts
    91

    Re: Pesky "Object Required" error

    yes, its part of a long sub Main() i would be willing to share, but it might be too long to post. Is there another option?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Pesky "Object Required" error

    I think we would need to see more of the code, perhaps not all of it, to determine what the problem is.

    If it's to long to post then you could upload a sample workbook with the code in it and, maybe some explanation of how you are using this function, and the rest of the relevant code.

    PS Just forgot, might be helpful to know which line of code that's causing the error.

  7. #7
    Registered User
    Join Date
    08-27-2014
    Location
    Albany, NY
    MS-Off Ver
    Office 2010
    Posts
    91

    Re: Pesky "Object Required" error

    Man, you mean its not OBVIOUS? lol I worked with it so long yesterday that I I was brain fried.

    The line bugging out is:
    Please Login or Register  to view this content.
    the rest of the relevant code (as i see it) is:
    Please Login or Register  to view this content.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Pesky "Object Required" error

    Where is the code located?

    Can you upload a sample workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  9. #9
    Registered User
    Join Date
    08-27-2014
    Location
    Albany, NY
    MS-Off Ver
    Office 2010
    Posts
    91

    Re: Pesky "Object Required" error

    I did get it working. I needed to wrap the range data type as a variant data type because my collection was returning Variant Data types so the range data type addition was failing.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro generates the following error: "run-time error 424 object required"
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-23-2014, 06:31 PM
  2. Set Variable = File Path generates "Object Required" Error
    By Brian48072 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2013, 11:42 AM
  3. The pesky "Object variable or With block variable not set" error
    By pjmulero in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-22-2012, 05:58 PM
  4. [SOLVED] Excel 2007 : Help to Solve Run-time Error 424 "Object Required"
    By D.S.Rama Rao in forum Excel General
    Replies: 6
    Last Post: 03-05-2012, 03:24 PM
  5. "Microsoft Visual Basic runtime error '424' object required".
    By SharonG. in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-04-2006, 08:40 PM

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