+ Reply to Thread
Results 1 to 7 of 7

Macro for automation of a sort column, Code nearly complete.

  1. #1
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    177

    Macro for automation of a sort column, Code nearly complete.

    Please Login or Register  to view this content.
    This is what i have so far, but basically i have a file which I sort through various headers, so i have a default sort column in V so i can return to the original state any time i want. I normally go through the process of putting a 1 in cell 1, column v, then a 2 , and 3 after. highlight all 3 cells and move down the file so i have a default sort column. The problem is the files are various sizes ranging from 2000 rows to even more. Is there a way I can have a macro put a 1 , 2 , 3 and drag down untill the last cell of data? this is the part i couldnt figure out. I want it dynamic in other words, currently i have to enter the row number for it to count to. I have to do this many times because i delete rows, add data, so i have to redo the default counter so i dont lose any of the data's placements when i sort again.

    Thanks



    THanks
    Last edited by donnydorko; 02-06-2009 at 05:18 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Need Macro to make a sort column / Counter

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    You also need to be more careful with the wording of your Thread Titles
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    177

    Re: Macro for automation of a sort column, Help with Code.

    sorry about that, hopefully this clears things up , added the tags as required.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Macro for automation of a sort column, Code nearly complete.

    This assumes col U has the last data in. Change to suit

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    177

    Re: Macro for automation of a sort column, Code nearly complete.

    Says run time error 1004,

    autofill method of Range class failed.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Macro for automation of a sort column, Code nearly complete.

    I also get that message if nothing in Col U.

    Did you see my note.
    This assumes col U has the last data in. Change to suit
    Change the Col U to a column you know as data

    VBA Noob

  7. #7
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    177

    Re: Macro for automation of a sort column, Code nearly complete.

    Perfect, thanks again man.

    Probably simple requests, but this makes a world of difference, i love this forum!

+ 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