Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Help Again with data comparison

Hi everybody!

I got very good help that helped me to solve my initial problem in part.

The programing below works well, but what if the data range goes form G2:Q36?

Many thanks to all of you,

Marilyne

Private Sub Worksheet_Calculate()
Dim Sh As Worksheet
Dim MaxVal As Double
Dim MaxSh As String

For Each Sh In Me.Parent.Worksheets
If Sh.Name < Me.Name Then
If Sh.Range("G2:Q36").Value MaxVal Then
MaxVal = Sh.Range("G2:Q36").Value
MaxSh = Sh.Name
End If
End If
Next Sh

Select Case MaxSh
Case "Phase 1"
Me.Range("G2:Q36").Interior.ColorIndex = 6
Case "Phase 2"
Me.Range("G2:Q36").Interior.ColorIndex = 4
Case "Phase 3"
Me.Range("G2:Q36").Interior.ColorIndex = 3
Case "Phase 4"
Me.Range("G2:Q36").Interior.ColorIndex = 8
End Select

End Sub
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
data comparison Ktran Excel Discussion (Misc queries) 1 December 2nd 09 03:54 PM
data comparison Ktran Charts and Charting in Excel 0 December 2nd 09 08:21 AM
Data Comparison LPS Excel Discussion (Misc queries) 1 March 31st 08 05:33 PM
Data comparison j jbon Excel Worksheet Functions 1 September 22nd 06 10:22 PM
Data comparison TonyB Excel Worksheet Functions 1 March 1st 05 04:04 PM


All times are GMT +1. The time now is 10:01 PM.

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"