+ Reply to Thread
Results 1 to 5 of 5

AutoFit columns with macro

  1. #1
    Registered User
    Join Date
    02-25-2014
    Location
    Southampton
    MS-Off Ver
    Excel 2003
    Posts
    49

    AutoFit columns with macro

    Hi all I am trying to program a macro to AutoFit 29 columns on 3 different sheets. However it keeps coming up with "run-time error '1004' select method of range class failed".
    here is the code if it helps
    Please Login or Register  to view this content.
    Please help.

    Kind regards

    Deano

  2. #2
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,854

    Re: AutoFit columns with macro

    Hi
    I find it
    Please Login or Register  to view this content.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  3. #3
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: AutoFit columns with macro

    There is nothing wrong with this line.
    Please Login or Register  to view this content.
    But you can do a short cut

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-25-2014
    Location
    Southampton
    MS-Off Ver
    Excel 2003
    Posts
    49

    Re: AutoFit columns with macro

    so that mow works but now the next part of the code is not working i need to delete a group of columns and error 1004 comes up.
    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: AutoFit columns with macro

    When I run this code, I did not get any error.

    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] How to autofit a selection of columns?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2012, 09:46 AM
  2. Autofit all columns
    By cultavix in forum Excel General
    Replies: 2
    Last Post: 11-25-2008, 07:26 AM
  3. Autofit some columns
    By Me in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2005, 05:06 PM
  4. autofit only visible columns
    By Testtest in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2005, 10:20 PM
  5. autofit the excel columns
    By cindyxl in forum Excel General
    Replies: 0
    Last Post: 02-09-2005, 12:39 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