programatically color fonts and auto sorting

Q

quaere_

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!
 
J

jtp

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!
 
Q

quaere_

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top