+ Reply to Thread
Results 1 to 14 of 14

Getting run-time error 424 object require

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Getting run-time error 424 object require

    Hi friends,

    I want to create inner and outer border macro to avoide repeated job and save time.
    I’m getting run-time error 424 object require error.

    Please Login or Register  to view this content.
    Any help will be highly appreciated.

    Thanking you in anticipation.
    Last edited by mso3; 08-27-2015 at 07:17 AM.
    Sincerely,

    mso3

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,946

    Re: Getting run-time error 424 object require

    This will run through but it probably doesn't do everything you want. The main problem is that the output from an InputBox is a text string, not a range object.

    You could use Application.InputBox instead to select a range. Whatever, try this and adapt it first.

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting run-time error 424 object require

    Hi TMS,
    Thank you.

    The code is working fine for outer border but not for inner border.

    Suppose I want a outer border from range 'B2' then it's working fine.
    if I want a inner border from range 'B5' then it's not working. The inner border starts from range 'B2' instead of range 'B5'.

    Thanking you.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,946

    Re: Getting run-time error 424 object require

    Trouble is, I don't know what values (cell ranges) you are putting in for each of the Input Boxes so I can't step through.

    I also don't know what you expect to see for a given range of cells based on what you enter.

  5. #5
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting run-time error 424 object require

    Hi TMS,
    Don't mind. Please see the file attached for your kind perusal to understand the requirement.

    I want to start outer border from cell ‘P2’
    I want to have a inner border from cell ‘P5’
    I don’t want inner border in range row 2:4 because there is a name of institution and other information merged columns.
    In row 5 there are the titles of the table.


    In outer border input box I enter cell range P2
    In inner border input box I enter cell range P5

    Hope this will help you to find the solution.
    Attached Files Attached Files
    Last edited by mso3; 08-27-2015 at 11:12 AM.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,946

    Re: Getting run-time error 424 object require

    I guess this is your problem:

    Please Login or Register  to view this content.

    Regards, TMS

  7. #7
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting run-time error 424 object require

    Hi TMS,

    Greetings from me!

    Let me clear first.
    I have to border the tables several times in different ranges daily.
    So to avoide my manual work and save time I want to create a program which will speed up my work. The file attached is a sample for you. That table is not my problem.

    To speed up my work I simply want to enter a cell address in the input box for inner and outer borders. This program will work for all tables in different ranges which will be helpful to our friends to speed up their task also.

    If it's not possible in a single program then we may create two separate programmes for inner and outer borders to achieve our target.

    Thank you and have a nice day.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,946

    Re: Getting run-time error 424 object require

    OK, this works for the specific example:

    Please Login or Register  to view this content.

    Regards, TMS

  9. #9
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting run-time error 424 object require

    Hi TMS,
    Good! Now we are very close to the target.

    Problems:
    Outer border: No right side outer border
    Inner border: Inner border is extended upto column H instead of column E

    There are two tables range:
    B2:E10; G2:J10

    Requirement:
    First table:
    Outer border: Range: B2:E10
    Inner border: Range: B5:E10

    Second table:
    Outer border: Range: G2:J10
    Inner border: Range: G5:J10

    Everything else is correct.

    Thank you for taking a trouble to achieve target positively.
    Attached Files Attached Files

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,946

    Re: Getting run-time error 424 object require

    The problem is that you have Merged Cells. If you just use Centre Across Selection, rather then Merge and Centre, the code works just fine.

    However, the merged cells cause the calculation of the end cell to be skewed ... so the Horizontal Inner Border is longer than it should be.

    You need to remove the Merged Cells or, alternatively, determine the last column based on the data present, perhaps in row 5 as that seems to have the headers.

    If you remove the Merged Cells, the code will work as expected and as it did for the original example. If you wanted to use an alternative approach, the data, or more specifically, the header content would need to be populated consistently. As it appears that there could be more than one table, you cannot use End(xlToLeft) to determine the last column, therefore you would need to use End(xlToRight) but there must not be any blank spaces in the header row (in the table area)

  11. #11
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting run-time error 424 object require

    Hi TMS,
    Thank you.

    I want to merge in center to center the title information. However I merge center across as per your suggestion but in vain.

    I would like to use the alternative approach positively. However, I didn't understand your suggestion properly. Will you please attach a workbook with this alternative approach for my better understanding and solve the problem today positively.

    Thanking you,

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,946

    Re: Getting run-time error 424 object require

    Please Login or Register  to view this content.

    See the example. Look at the code in Module 2 (as above)

    Regards, TMS
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting run-time error 424 object require

    Hi TMS,
    Superb! What a excellent program to border tables quickly.

    I by heart appreciate you for taking a lot of trouble to achieve the target finally with a concrete solution.

    Thank you and have a nice day.

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,946

    Re: Getting run-time error 424 object require

    You're welcome. Thanks for the rep.

+ 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] Getting compile error 424 object require
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2015, 10:27 PM
  2. [SOLVED] Sort Macro Run-time error '1004': Application/Object-defined error.
    By sam1212 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2014, 10:05 AM
  3. Getting error 424 object require
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2014, 12:06 AM
  4. [SOLVED] Getting error 424 object require
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-09-2014, 04:53 AM
  5. Replies: 7
    Last Post: 05-15-2013, 09:02 AM
  6. [SOLVED] object require error
    By necalabria in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-26-2012, 08:46 PM
  7. Replies: 5
    Last Post: 08-10-2005, 05:05 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