PC Review


Reply
Thread Tools Rate Thread

How do I set up conditional formatting to give the greenbar effect?

 
 
Saucer Man
Guest
Posts: n/a
 
      8th Jan 2009
I want my excel workbook to have the greenbar effect starting with row 4. I
have 12 worksheets in the workbook. I would like the sheets to have this
effect as the data is being entered row by row daily. How can I do this?

--
Thanks!


 
Reply With Quote
 
 
 
 
jvbelg
Guest
Posts: n/a
 
      8th Jan 2009
On Jan 8, 8:32*am, "Saucer Man" <saucer...@nospam.com> wrote:
> I want my excel workbook to have the greenbar effect starting with row 4.*I
> have 12 worksheets in the workbook. *I would like the sheets to have this
> effect as the data is being entered row by row daily. *How can I do this?
>
> --
> Thanks!


I am using the macro below since many years.
You select the area you want to be subject to the greenbar effect and
run the macro.
Change the ColorIndex number to get green.

Have fun!


~~~~~~~~~
'Make GreenBar spreadsheet
'
Sub GreenBar()

Application.ScreenUpdating = False

Dim iRows, iStartRow, iEndRow As Integer
Dim iColumns, iStartColumn, iEndColumn As Integer
Dim RCounter, CCounter As Integer

With Selection
iRows = .Rows.Count
iStartRow = .Row
iEndRow = .Row + iRows - 1

iColumns = .Columns.Count
iStartColumn = .Column
iEndColumn = .Column + iColumns - 1
End With

For RCounter = iStartRow + 1 To iEndRow Step 2
For CCounter = iStartColumn To iEndColumn
With Cells(RCounter, CCounter).Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Next CCounter
Next RCounter

End Sub
 
Reply With Quote
 
Saucer Man
Guest
Posts: n/a
 
      8th Jan 2009
Thanks however that's not exactly what I am looking for. I want the entire
sheet to have the effect. I don't want the user to be required to select
text and then color it. Every row should have that effect even if they
haven't been used yet.


"jvbelg" <(E-Mail Removed)> wrote in message
news:bafe84f7-51d8-48f5-b3c0-(E-Mail Removed)...
On Jan 8, 8:32 am, "Saucer Man" <saucer...@nospam.com> wrote:
> I want my excel workbook to have the greenbar effect starting with row 4.
> I
> have 12 worksheets in the workbook. I would like the sheets to have this
> effect as the data is being entered row by row daily. How can I do this?
>
> --
> Thanks!


I am using the macro below since many years.
You select the area you want to be subject to the greenbar effect and
run the macro.
Change the ColorIndex number to get green.

Have fun!


~~~~~~~~~
'Make GreenBar spreadsheet
'
Sub GreenBar()

Application.ScreenUpdating = False

Dim iRows, iStartRow, iEndRow As Integer
Dim iColumns, iStartColumn, iEndColumn As Integer
Dim RCounter, CCounter As Integer

With Selection
iRows = .Rows.Count
iStartRow = .Row
iEndRow = .Row + iRows - 1

iColumns = .Columns.Count
iStartColumn = .Column
iEndColumn = .Column + iColumns - 1
End With

For RCounter = iStartRow + 1 To iEndRow Step 2
For CCounter = iStartColumn To iEndColumn
With Cells(RCounter, CCounter).Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Next CCounter
Next RCounter

End Sub


 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      8th Jan 2009
If you actually mean to only color a row if it has data in it then...
Select the rows and use this CF formula...
=COUNTA(1:1)>0

Otherwise just color the rows.
--
Jim Cone
Portland, Oregon USA


"Saucer Man"
<(E-Mail Removed)>
wrote in message
Thanks however that's not exactly what I am looking for. I want the entire
sheet to have the effect. I don't want the user to be required to select
text and then color it. Every row should have that effect even if they
haven't been used yet.

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      8th Jan 2009
Maybe you can adapt this to suit your purposes. Put this in the worksheet
code module. It uses the
Autoformat facility of Excel to set the patterns, so if you want to clear
the formatting manually, just do Edit>Clear>All. For VBA use Cells.Clear.
The built in format reduces the width of column A. so I inserted a line of
code to reset the width to standard. You might have to make additional
modifications, depending on your column width requirements.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target = Range("A1") Then
ActiveSheet.Cells.AutoFormat Format:=xlRangeAutoFormatList1
End If
Columns(1).ColumnWidth = 8.43
End Sub






"Saucer Man" wrote:

> Thanks however that's not exactly what I am looking for. I want the entire
> sheet to have the effect. I don't want the user to be required to select
> text and then color it. Every row should have that effect even if they
> haven't been used yet.
>
>
> "jvbelg" <(E-Mail Removed)> wrote in message
> news:bafe84f7-51d8-48f5-b3c0-(E-Mail Removed)...
> On Jan 8, 8:32 am, "Saucer Man" <saucer...@nospam.com> wrote:
> > I want my excel workbook to have the greenbar effect starting with row 4.
> > I
> > have 12 worksheets in the workbook. I would like the sheets to have this
> > effect as the data is being entered row by row daily. How can I do this?
> >
> > --
> > Thanks!

>
> I am using the macro below since many years.
> You select the area you want to be subject to the greenbar effect and
> run the macro.
> Change the ColorIndex number to get green.
>
> Have fun!
>
>
> ~~~~~~~~~
> 'Make GreenBar spreadsheet
> '
> Sub GreenBar()
>
> Application.ScreenUpdating = False
>
> Dim iRows, iStartRow, iEndRow As Integer
> Dim iColumns, iStartColumn, iEndColumn As Integer
> Dim RCounter, CCounter As Integer
>
> With Selection
> iRows = .Rows.Count
> iStartRow = .Row
> iEndRow = .Row + iRows - 1
>
> iColumns = .Columns.Count
> iStartColumn = .Column
> iEndColumn = .Column + iColumns - 1
> End With
>
> For RCounter = iStartRow + 1 To iEndRow Step 2
> For CCounter = iStartColumn To iEndColumn
> With Cells(RCounter, CCounter).Interior
> .ColorIndex = 36
> .Pattern = xlSolid
> End With
> Next CCounter
> Next RCounter
>
> End Sub
>
>
>

 
Reply With Quote
 
Saucer Man
Guest
Posts: n/a
 
      8th Jan 2009
Thanks for the replies. I got it to work by using the following 2
conditional formulas...

=MOD(ROW(),2)=0
=MOD(ROW(),2)<>0

Then I selected a different color for each one.

"Saucer Man" <(E-Mail Removed)> wrote in message
news:49660055$0$31085$(E-Mail Removed)...
>I want my excel workbook to have the greenbar effect starting with row 4.
>I have 12 worksheets in the workbook. I would like the sheets to have this
>effect as the data is being entered row by row daily. How can I do this?
>
> --
> Thanks!
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting v VBE code for desired effect Judy Cohen Microsoft Excel Programming 1 18th Jun 2010 05:21 AM
Automatic greenbar effect, varied color, corrects with re-format =?Utf-8?B?QnJlbnQgLS0gRE5B?= Microsoft Excel Worksheet Functions 1 11th Feb 2006 06:05 PM
Effect of Conditional Formatting, Data Validation =?Utf-8?B?QmlsbCBTdHVyZGV2YW50?= Microsoft Excel Misc 1 25th Jan 2005 11:50 PM
Conditions not me but conditional formatting still takes effect =?Utf-8?B?am9lbWM5MTE=?= Microsoft Excel Misc 2 28th May 2004 02:35 PM
Make a greenbar page in Excel using Conditional Formatting dsample Microsoft Excel Discussion 1 13th Apr 2004 05:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:49 PM.