+ Reply to Thread
Results 1 to 4 of 4

Sorting

  1. #1
    Greg B
    Guest

    Sorting

    I want to sort information in columns a to columns f the I need this to be
    done by macro the problem is when I have a new person come in to the place i
    would have to rewrite the code. is the any way at all to have a macro count
    the rows start from row 3.

    Thanks in advance

    Greg



  2. #2
    Greg B
    Guest

    Re: Sorting


    I want to sort information in (columns a : columns f) I need this to be
    done by macro. The problem I am having is when I have a new person come in
    to the place i
    would have to rewrite the code. Is there any way at all to have a macro
    count the rows, starting from row 3.

    Thanks in advance

    Greg



  3. #3
    Registered User
    Join Date
    01-30-2006
    Posts
    5
    In say cell Z1 of the sheet, enter the formula;

    =65534-COUNTIF(A3:A65536,"")


    Them in your macro, do the following;

    Range("A3:I" & Range ("Z1").value)+2).Select
    Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlGuess, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    DataOption1:=xlSortNormal


    I don't think there's a way of counting in VB itself. This is the method I've always used.

    Hope this helps,


    Dan

  4. #4
    Greg B
    Guest

    Re: Sorting

    Thanks will give it a go

    Greg
    "dspencer" <[email protected]> wrote in
    message news:[email protected]...
    >
    > In say cell Z1 of the sheet, enter the formula;
    >
    > =65534-COUNTIF(A3:A65536,"")
    >
    >
    > Them in your macro, do the following;
    >
    > Range("A3:I" & Range ("Z1").value)+2).Select
    > Selection.Sort Key1:=Range("A3"), Order1:=xlAscending,
    > Header:=xlGuess, _
    > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
    > _
    > DataOption1:=xlSortNormal
    >
    >
    > I don't think there's a way of counting in VB itself. This is the
    > method I've always used.
    >
    > Hope this helps,
    >
    >
    > Dan
    >
    >
    > --
    > dspencer
    > ------------------------------------------------------------------------
    > dspencer's Profile:
    > http://www.excelforum.com/member.php...o&userid=30967
    > View this thread: http://www.excelforum.com/showthread...hreadid=506333
    >




+ 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