LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 259
Default For Each Next

Hi all

Still can't get my head in the right place regarding the subject matter.

I am trying to set up a scoreboard of sorts.

The idea is that if there is a Team Name ( tName ) in Column A then look
at the Team Score ( tScore ) range and for every Cell in ( tScore )
that's back color = 65535 then that Cells value is doubled.

Then the Team's Total will be a Sum of the row that fits within the (
tScore ) range.

the below falls into the N.Q.R. category

Sub Update_Score()

Dim tScore As Range, tTotal As Range
Dim tName As Range
Dim i As Integer

For i = 2 To 32

Set tName = Sheets("Scoreboard").Range("A:A")
Set tScore = Sheets("Scoreboard").Range("B:I")
Set tTotal = Sheets("Scoreboard").Range("J:J")

If Cells(i, tName).Value < "" Then
For Each Cell In tScore
If Cells(i, tScore).Interior.Color = 65535 Then
Cells(i, tScore).Value = Cells(i, tScore).Value * 2
Cells(i, tTotal).Value = WorksheetFunction.Sum(i, tScore)
Next Cell
Else
Exit For
End If
End If

Next i

End Sub

As always your assistance is most appreciated

TIA
Mick.
 
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



All times are GMT +1. The time now is 04:30 AM.

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

About Us

"It's about Microsoft Excel"