+ Reply to Thread
Results 1 to 4 of 4

Sorting and conditional formatting

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Conditional formatting

    Hi

    The effects you are looking for with conditional formatting are a little awkward to achieve, however in VBA it is possible.

    The revised spreadsheet with VBA code is attached and I think covers what you are looking for. To view the code right click on the results tab and click view code.

    To use different colors just change the values for colors 1, 2 & 3.

    Regards

    Jeff
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-25-2008
    Posts
    8
    Thank you very much, solnajeff. I appreciate your help. There was a small error in your code. I fixed it. I also made some adjustments to the colors for my purposes. I atached the corrected file.

  3. #3
    Registered User
    Join Date
    05-25-2008
    Posts
    8
    And may I dare to ask for additional help? If the moderators decide, I can move these addititonal questions to a new thread. They are related to the same example. The questions:
    1. Let us assume that we want to see from the tables in sheet Results only the top three and the last three rows of them. And we want to see them in the form of two new tables above the old tables. I atached the same file with a new sheet called Demo. In Demo I put six examples depending of how many rows we have in lower tables. Examples 2-6 describes how the upper tables should look when the lower tables contain less than 7 rows. Sheet Demo provides only illustrations.
    2. The same descending sorting should be applied. Top three rows are colored in green and the last three in red (see 1. for more detailed explanation). We will have two new tables (left and right) with the headings, then top three rows and last three rows.
    3. I suppose that in these new conditions the old tables in sheet Results may start from row 20. And the new tables should start from row 6.
    4. All this should depend on the filtering of the comboboxes.
    5. The contents of upper tables are part of the lower tables.

    I tried to do point 3, but I don't know how exatly to apply conditional formationg to the new postition of the old tables. The conditional formating is applied to the old position by the VBA code. I was looking into this part of code for the solution:

    Let a = Application.CountA(Columns(1))
    Let b = Round(a * 0.25, 0)
    Let c = Application.CountA(Columns(5))
    Let d = Round(c * 0.25, 0)
    Thank you

+ 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