+ Reply to Thread
Results 1 to 3 of 3

programatically color fonts and auto sorting

  1. #1

    programatically color fonts and auto sorting

    hi

    I am currently doing a spreadsheet by excel.

    I am thinking of 1 worksheet that holds all the data like a database.
    Then in the other sheets are the sorted and processed sheets to show
    data extracted.

    Lets call my database "DATABASE" and first worksheet would be "Shipping
    Schedule"

    First problem:

    for each row in Shipping Schedule worksheet, if under the REMARKS
    column is a "shipped"
    I would like to change the font of the whole row automatically to red
    words.

    Conditional formatting does not seem to work for me as it does not seem
    to run for each row. I believe, I will need a loop to do this. Can
    someone help me with this?

    Problem 2:
    when I open Shipping schedule, I like it to sort automatically by date
    as well under columns call "Fty ETD", then "buyer Etd", then "price" in
    order of priority.

    this is because, our clerks will be typeing in data in the DATABASE
    worksheet and when they click on Shipping Schedule worksheet, all the
    info would be there and sorted automatically without doing it manually.

    pls help. Thanks!


  2. #2
    Forum Contributor
    Join Date
    03-15-2005
    Location
    North Carolina
    MS-Off Ver
    2003 & 2007
    Posts
    180
    I believe there is a way to setup conditional formatting to do this but if you want the code for it, try this: (Assuming Column A has non-blank cells and Column B is the Remarks column)

    Sub ConditionalFormatting()
    Dim cell As Range

    Set cell = Range("A1")

    While cell <> ""
    If LCase(cell.Offset(0, 1).Value) = "shipped" Then
    cell.EntireRow.Font.Color = vbRed
    End If
    Set cell = cell.Offset(1, 0)
    Wend

    End Sub


    Now for your filter, it would probably be easier for you to just record a macro and set up the sort the way you want it since you kind of need to know what the headings are for each column you want to sort by. After recording it, place the code in the "Shipping Schedule" worksheet object using this Subroutine:

    Sub Worksheet_Activate()

    'The recorded macro

    End Sub


    Hope this helps some,

    Jason



    hi

    I am currently doing a spreadsheet by excel.

    I am thinking of 1 worksheet that holds all the data like a database.
    Then in the other sheets are the sorted and processed sheets to show
    data extracted.

    Lets call my database "DATABASE" and first worksheet would be "Shipping
    Schedule"

    First problem:

    for each row in Shipping Schedule worksheet, if under the REMARKS
    column is a "shipped"
    I would like to change the font of the whole row automatically to red
    words.

    Conditional formatting does not seem to work for me as it does not seem
    to run for each row. I believe, I will need a loop to do this. Can
    someone help me with this?

    Problem 2:
    when I open Shipping schedule, I like it to sort automatically by date
    as well under columns call "Fty ETD", then "buyer Etd", then "price" in
    order of priority.

    this is because, our clerks will be typeing in data in the DATABASE
    worksheet and when they click on Shipping Schedule worksheet, all the
    info would be there and sorted automatically without doing it manually.

    pls help. Thanks!

  3. #3

    Re: programatically color fonts and auto sorting

    hi Jason thanks a million let me try this out!! Merry Christmas ans
    happy new year =)


+ 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