+ Reply to Thread
Results 1 to 4 of 4

*probably simple* 'object required' error

  1. #1
    Registered User
    Join Date
    02-21-2015
    Location
    West Point, NY
    MS-Off Ver
    2007
    Posts
    4

    *probably simple* 'object required' error

    Hey folks, I'm just starting to learn VBA and I've been struggling with one string of code on one of my side projects.
    Untitled.png

    I'm trying to copy a range and paste its values and formatting to the last empty cell after the last not-empty cell in column B

    I've got white text on the top left corner of each range so the don't overlap. The second range under "trip sections" is what I'm trying to accomplish with VBA.

    I commented it out so I know the issue is with "lastRowTS =Range ..."

    Please Login or Register  to view this content.
    Last edited by AaronChurchill; 02-21-2015 at 02:10 PM.

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: *probably simple* 'object required' error

    Hi and welcome to the forum,

    As per forum rules, please use code tags around your code.

    You can simplify your code like this :
    Please Login or Register  to view this content.
    Don't use .SELECT and .ACTIVATE as it slows down your code
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Registered User
    Join Date
    02-21-2015
    Location
    West Point, NY
    MS-Off Ver
    2007
    Posts
    4

    Re: *probably simple* 'object required' error

    Thanks for the quick response!

    I knew Ide end up breaking a rule immediately, once I chose not to read the rules. :p

    I guess I better go read them now!

    That code worked, thanks!

    since I won't soon be able to write a code as intuitivly as GC's solution, could anyone tell me why my own code didnt work?
    Last edited by AaronChurchill; 02-21-2015 at 06:35 PM.

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: *probably simple* 'object required' error

    Hello,

    the problem is this line :
    Please Login or Register  to view this content.
    When you want to "pass" a cell to a range variable you need to "SET" it, like this :
    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)

Similar Threads

  1. [SOLVED] Simple Calendar pop up macro --> error Run-time error '424': Object required
    By am_hawk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2013, 10:38 AM
  2. [SOLVED] Simple object required error in loop
    By Dunctonsteel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2013, 01:16 PM
  3. Name.Object (Error Object Required)
    By dssrun209 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2010, 01:38 PM
  4. Error 424 Object Required Error when Using AddItem to ListBox Generated in Code
    By jclark419 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2010, 12:47 PM
  5. Object Required Error
    By xyz123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2008, 08:25 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