Interier Worksheet Formating for Rows.

S

Shazi

Greetings from Madinah.

I am preparing VBA application, and I have DailyPurchase worksheet,
having 300 records. User can feed data by UserForm, having 12
different fields.

thats working fine. but I want to enter all the data like this.

Row1 all entries should be Blue
Row2 all entries should be Green
Row3 all entries should be Blue
Row4 all entries should be Green
Row5 all entries should be Blue like this

I mean one row should be Blue and next row should be Green, for Easy
Viewing
all data in worksheet.

If it is possible, pls send me your suggessions, and pls tell me this
should be possible from Userform or Worksheet Event.

with best regards.

Syed Shahzad Zafar.
Madinah
 
C

Charlie

Dim Cell As Range

For Each Cell In Range("A1:A300")
If (Cell.Row And 1) = 1 Then
Rows(Cell.Row).Interior.ColorIndex = 37
Else
Rows(Cell.Row).Interior.ColorIndex = 35
End If
Next Cell
 
B

Bernie Deitrick

Madinah,

Select cells A1 to the end of your sheet for the used columns, and format the cells BLUE. Then use
Format / Conditional Formatting, Formula is... with the formula

=AND($A1<>"",MOD(ROW($A1),2)=0)

and then set the format to GREEN. This will format all even numbered rows green where column A is
filled in, for all columns selected at the time the formatting was applied.

HTH,
Bernie
MS Excel MVP
 
S

Shazi

Madinah,

Select cells A1 to the end of your sheet for the used columns, and formatthe cells BLUE. Then use
Format / Conditional Formatting, Formula is... with the formula

=AND($A1<>"",MOD(ROW($A1),2)=0)

and then set the format to GREEN.  This will format all even numbered rows green where column A is
filled in, for all columns selected at the time the formatting was applied.

HTH,
Bernie
MS Excel MVP















- Show quoted text -

Dear Bernie,

I used your formula in my sheet, it is exactly what I want. Thanks for
your support.

Once again thank you for taking time for me.

Best Regards,

Shahzad Zafar
Madinah
 
S

Shazi

Dim Cell As Range

    For Each Cell In Range("A1:A300")
    If (Cell.Row And 1) = 1 Then
        Rows(Cell.Row).Interior.ColorIndex = 37
      Else
        Rows(Cell.Row).Interior.ColorIndex = 35
      End If
    Next Cell












- Show quoted text -

Hi,

I also used your formula, it is also good, thank you for taking time
for me.

Best Regards.

Shahzad
 

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