Consulting

Results 1 to 2 of 2

Thread: Problem about sort horizontal with Function.

  1. #1

    Problem about sort horizontal with Function.

    Hello everyone!
    I need your help and expertise here. I'm trying to get my head around VBA to sort horizontal rows based on comparison of certain values under specific column headings.
    Before the results are as shown in the URL image below.


    ColumnA ColumnB ColumnC ColumnD ColumnE ColumnF ColumnG ColumnH
    111 222 333 444 555 666 777 888


    ColumnB and ColumnF have similar header name like "cost_default_smsc_1" and "cost_default_smsc_2". The cost will be compared and then display in ascending order.
    Taking for example, ColumnF of 666 is cheaper than ColumnB of 222.
    Column A, B,C,D belonged to a set of product, while E,F,G,H belong to another set. There are up to 10 products.


    The resulting output in this case will be,


    ColumnA ColumnB ColumnC ColumnD ColumnE ColumnF ColumnG ColumnH
    555 666 777 888 111 222 333 444

    Thank's a lot!
    Chúng tôi cộng đồng internet việt nam website https://internetvietnam.net/https://dulichviet.net.vn/https://jobs.drupal.org/company/15207 sự lựa chọn tốt nhất khi khách hàng một cách hiệu quả.

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    It sounds like you want to look at the four cell block A11 , compare it with the four cell block E1:H1

    And the swap (or not) those blocks of 4 cells depending on the value of the second cell.

    Is that the goal?

    Where do you want the resulting values?

    Could you attach a workbook with some sample data and the desired result?

Posting Permissions

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