+ Reply to Thread
Results 1 to 7 of 7

Setting a range variable to its offset triggers an "Object required" error

  1. #1
    Registered User
    Join Date
    07-22-2012
    Location
    The Shire
    MS-Off Ver
    Office 2013
    Posts
    51

    Setting a range variable to its offset triggers an "Object required" error

    Hello,

    I have a tiny bit of code that behaves erratically and I cannot figure out why.

    Please Login or Register  to view this content.
    The problem lies with "Start_Cell.Offset(1,0)". For some reason "Set Start_Cell = Start_Cell.Offset(1, 0)" raises an "Object required" error.
    The first "MsgBox (Start_Cell.Offset(1, 0))" works fine. Opening a new workbook, inserting a new userform and pasting the same code and entering "Start" in a cell have the same behaviour - it raises an error. Closing all Excel workbooks, opening a new one, inserting a userform, etc. works fine.

    I also tried declaring another range variable and setting it to the offset, instead. I.e.:

    Please Login or Register  to view this content.
    Same error.

    I am at a dead end. :/
    Last edited by Durarara; 03-27-2016 at 02:30 PM.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Setting a range variable to its offset triggers an "Object required" error

    You might have to attach a sample of your workbook with the userform and code in it. I copied and pasted the code you provided and it worked ok as long as the word start was in a cell.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    07-16-2015
    Location
    Brighton, England
    MS-Off Ver
    2010
    Posts
    71

    Re: Setting a range variable to its offset triggers an "Object required" error

    try removing the 'set'

  4. #4
    Registered User
    Join Date
    07-22-2012
    Location
    The Shire
    MS-Off Ver
    Office 2013
    Posts
    51

    Re: Setting a range variable to its offset triggers an "Object required" error

    graym463, I tried it earlier but it didn't help.

    Here is the workbook, I changed the names of the variables here to make it more readable.

    The code is in "UserForm1".
    Attached Files Attached Files

  5. #5
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Setting a range variable to its offset triggers an "Object required" error

    There is a typo in your userform code
    Change
    Please Login or Register  to view this content.
    To
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-22-2012
    Location
    The Shire
    MS-Off Ver
    Office 2013
    Posts
    51

    Re: Setting a range variable to its offset triggers an "Object required" error

    *facepalm*

    I knew it'd be something completely trivial I am missing.

    This will teach me to paste the proper code next time, thanks a bunch!

  7. #7
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Setting a range variable to its offset triggers an "Object required" error

    Not a problem....happens to a bunch of us.....I know I've done it a time or 10.

+ 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. Replies: 1
    Last Post: 09-07-2012, 12:08 AM
  4. "Object required" error with VBA loop rows deleting
    By JKWIN in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2012, 09:31 AM
  5. [SOLVED] "Object required" error in combo box/macro combination
    By chemeng1T3 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-09-2012, 10:32 AM
  6. [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
  7. Error msgs: "Object varible or with block variable not set"; "subscript out of range"
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 04:58 PM
  8. [SOLVED] "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

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