+ Reply to Thread
Results 1 to 2 of 2

Run Time Error 424 when adjusting row height

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-13-2009
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    136

    Run Time Error 424 when adjusting row height

    I am pulling my hair out trying to figure out what is wrong with this line:

    rng.Offset(4, 0).RowHeight.AutoFit
    I've tried a number of different ways of writing this such as:

    rng.Offset(4, 0).Rows.RowHeight.AutoFit
    Rng refers to a single cell that is passed to my subroutine from a calling sub. It keeps saying:

    Run Time Error '424': Object Required

    Please help me figure this out.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526

    Re: Run Time Error 424 when adjusting row height

    You haven't supplied all the code,
    If the code is set up correctly, this should work,
    rng.Offset(4, 0).EntireRow.AutoFit

+ 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