Thank you so much for your replies.

The problem situation is to highlight the maximum value in each row . Each row would have the same no. of columns of data.

A B C D

ir** -0.7** 0.30 0.25

ia ** 0.7 ** 0.23 0.24

__hh__** -0.69** 0.24 0.17

h 0.23 **0.77** 0.22

a 0.24 **0.71** 0.23

__ q 0.31 __**0.72 ** 0.3

u 0.3 0.22 **0.63**

__ b 0.4 0.3 __**0.59**

My approach is I assigned all the valid data cells of each row to a range variable names myrange1, myrange2, myrange3 ....myrange62

Set myrange1 = Range("B11", Cells(11, Columns.Count).End(xlToLeft))

Set myrange2 = Range("B12", Cells(12, Columns.Count).End(xlToLeft))

myMax1 = Abs(WorksheetFunction.Max(myrange1))

myMax2 = Abs(WorksheetFunction.Max(myrange2))

.

.

.

myMax62 = Abs(WorksheetFunction.Max(myrange3))

myMin1 = Abs(WorksheetFunction.Min(myrange1))

myMin2 = Abs(WorksheetFunction.Min(myrange2)).

.

.

Maxx1 = IIf(myMax1 > myMin1, myMax1, myMin1)

Maxx2 = IIf(myMax2 > myMin2, myMax2, myMin2)

...

The last row I am assuming is 62 as data would not go over 62nd line in my case . However, no. of rows would always change in every unique case and there would be always a room for error if data indeed goes beyond 62nd row. Is there any way, I could assign range variables only till that row which has data

For example

The data below implies I only need to define range variables namely

Myrange1 = range("A1:B1")

till

Myrange7 = range("A7:B7")

A B

2 5

3.4 8

5 12

6 23

77 56

8 7

9 6

The syntax:

LastRow = Selection.SpecialCells(xlCellTypeLastCell).Row

helps by giving the number of the last valid data row, but I am not sure how this might be used if at all in automatically assigning ranges of valid row cells to variables.

Once I assign ranges , the next step I did is to format the absolute value of cell IN EACH ROW. As of now, I am defining as many For loops as there are valid rows.

For Each c In myrange1

If Abs(c.Value) = Maxx1 Then

c.font.Bold = True

c.Interior.ThemeColor = xlThemeColorDark1

c.Interior.TintAndShade = -0.499984740745262

c.Select

Set obj1 = Selection ' Getting the object reference so I could check

' if the next below rows' maximum value's object ' belongs to the same column, if not, then will ' apply border Eg. -0.69 and its ID is bordered.

End If

Next c

' MsgBox Maxx1

End Sub

For Each c In myrange2

If Abs(c.Value) = Maxx2 Then

c.font.Bold = True

c.Interior.ThemeColor = xlThemeColorDark1

c.Interior.TintAndShade = -0.499984740745262

c.Select

Set obj2 = Selection

End If

Next c

End Sub

.

.

.

(till myrange62)

However, after running the entire code, I also get the error Too large for a procedure because of the repetition.

If some one could please let me know an efficient way of doing this, I would really appreciate it.