Sub a()Dim i, j, kFor i = 2 To Range("a2").End(xlDown).Rows + 1 For j = 2 To Range("b1").End(xlToRight).Columns + 1 If Cells(i, 1) >= Cells(1, j) Then Cells(i, j) = Cells(1, j) Else Cells(i, j) = Cells(i, 1) End If NextNextEnd Sub