Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Conditinal formatating

I have a large daatasheet with integer. After each group of data the average
is calculated and the results are introduced as decimals which starts from
column B to U.
I do want to have a yellow backgrund colour from A to U in this row with
the averages. How can I do that in VB.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Conditinal formatating

Try this code. It assumes the header row in in row 1 and the column A has no
blank cells from row 2 to the end.

Sub Gettotals()
'
'
'
RowCount = 2
Start = 2
Do While Range("A" & RowCount) < ""
If Range("A" & RowCount) < Range("A" & (RowCount + 1)) Then
Rows(RowCount + 1).Insert
Range("B" & (RowCount + 1)).Formula = _
"=Sum(B" & Start & ":B" & RowCount & ")"
Set SetSumRange = _
Range("B" & (RowCount + 1) & ":U" & (RowCount + 1))

Range("B" & (RowCount + 1)).Copy _
Destination:=SetSumRange

With SetSumRange.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With

RowCount = RowCount + 2
Start = RowCount
Else
RowCount = RowCount + 1
End If
Loop
End Sub


"Sverre" wrote:

I have a large daatasheet with integer. After each group of data the average
is calculated and the results are introduced as decimals which starts from
column B to U.
I do want to have a yellow backgrund colour from A to U in this row with
the averages. How can I do that in VB.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditinal Formatting PA New Users to Excel 1 October 4th 08 01:58 AM
Conditinal Formation WT Excel Worksheet Functions 1 July 10th 08 07:37 PM
Conditinal Format Bob[_12_] Excel Worksheet Functions 7 October 29th 07 07:30 PM
Conditinal Formatting Joe K. Excel Discussion (Misc queries) 0 October 22nd 07 02:51 AM
Conditinal Formatting Myriam Excel Programming 2 November 27th 06 09:11 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"