Results 1 to 10 of 10

Autofit error

Threaded View

  1. #1
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Autofit error

    I'm using Excel 2002.
    I just had a macro that has been working for months get an error
    Error #: 1004
    AutoFit method of Range class failed
    This is the section of code that triggered the error.
    All the variables are properly dimmed. I have verified that there was no error setting the value. The range is formatted as Number with 3 decimals. All the values are less than 11.
    With shCircuits
            Set r = .Range("TeamResults").Columns(iRace)
            r.Value = .Range("TeamPoints").Value
            r.EntireColumn.AutoFit        'Triggers Error
    End With
    It has been working fine for several months.

    Are there any reasons why autofit would fail? Help says it will fail only if r is not a column.
    The only thing I can think of is that the width of the sheet may have hit some limit. I am using column IU
    Last edited by foxguy; 01-20-2011 at 02:19 PM.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

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