Consulting

Results 1 to 3 of 3

Thread: peraphs impossible... order line base color...

  1. #1

    peraphs impossible... order line base color...

    Is possible to order line in sheet based 2 key, color in column AF and value in column AE????
    i use in standard mode:

    Sub ORDINA_REGIONI()

    Dim WS As Worksheet
    Dim ULTIMA As Long
    Dim MIO_RANGE As RANGE

    Set WS = Worksheets("STAT_NEW_1")

    With WS

    .Unprotect PASSWORD:="SAL21"

    ULTIMA = Sheets("STAT_NEW_1").RANGE("AF" & Rows.Count).End(xlUp).Row
    Set MIO_RANGE = Sheets("STAT_NEW_1").RANGE("A5:AF" & ULTIMA)
    MIO_RANGE.Sort Key1:=RANGE("AF5"), Order1:=xlAscending, Key2:=RANGE("A5") _
    , Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
    Orientation:=xlTopToBottom

    .Protect PASSWORD:="SAL21"

    End With

    End Sub
    Sal
    1 help 1 pizza
    2 help 1 pizza 1 caff?
    3 help 1 pizza 1 caff? 1 mozzarella
    ...
    Spaghetti, Lasagne and Tortellini for the "Lady" ;-)

  2. #2
    VBAX Mentor
    Joined
    Dec 2007
    Posts
    462
    Location
    I'm not sure I understand your question. Do you just want to change a cell or row color? if so Right click fomat cell , if it a row highlight the row and right click format cell.

  3. #3
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    You could try this, in a new workbook, put =ROW() in A1:A150 and =0 in A151. Then use Excel Options CustomList to import the custom list

    1,2,3,...,150,0

    When you Sort, sort on AE using that list as the sort order.

    Condiditonal formatting will keep the colors of AF correct.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •