comparing 9 columns

fredrerik84

Active Member
Joined
Feb 26, 2017
Messages
383
Hi my head is spinning here a little im trying to compere 9 column number to find highest values (also this number will be expanded later)

I want to return the highest number of these 3 Columns"J" "N" "R" result stored as variable double
I want to return the highest number of these 3 Columns"K" "O" "S" result stored as variable2 double
I want to return the highest number of these 3 Columns"L" "P" "T" result stored as variable3 double

results will be var1 + var2 + var3 in column W

Is this possible to to somehow? some of the rows in the columns might also be empty
data rows start from 12 (header in row 11) its around 200-300 data rows (varies)

I started making a for loop code for this but all my criterias makes me dizzy :/ hope someone a little more skilled know a good solution for this
 
Last edited:
I have one more question about your code, If coloumn J,K or L has the highest value I want this included in code . Is that possible

(from old code)
Code:
If Cells(i, "J") > Cells(i, "N") Then
   If Cells(i, "N").value <> "" Then
      home = Cells(i, "J")
      draw = Cells(i, "O")
      away = Cells(i, "P")
      Cells(i, "J").Font.Bold = True
      Cells(i, "J").Font.ThemeColor = xlThemeColorAccent5
      Range("B" & i & ":H" & i).Font.Bold = True
      Range("B" & i & ":H" & i).Font.ThemeColor = xlThemeColorAccent5
      
      Cells(i, "J").Borders(xlEdgeRight).ThemeColor = 9
      Cells(i, "J").Borders(xlEdgeRight).LineStyle = xlContinuous
      Cells(i, "J").Borders(xlEdgeRight).Weight = xlMedium
      
      Cells(i, "J").Borders(xlEdgeLeft).ThemeColor = 9
      Cells(i, "J").Borders(xlEdgeLeft).LineStyle = xlContinuous
      Cells(i, "J").Borders(xlEdgeLeft).Weight = xlMedium
      
      Cells(i, "J").Borders(xlEdgeTop).ThemeColor = 9
      Cells(i, "J").Borders(xlEdgeTop).LineStyle = xlContinuous
      Cells(i, "J").Borders(xlEdgeTop).Weight = xlMedium
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top