Using conditional formatting in excel to high

Closed
Report
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
Hello,

I want to highlight the row based on cell value. For example. If I put 10 in one cell, it should highlight 10 rows like that. please advise which formula I need to use in conditional formatting

3 replies

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
803
"put 10 in one cell, "

in which cell. what is the address of this cell


"should highlight 10 rows"

which ten rows.

give one or two actual examples
Hi,

Thanks for your reply.

Here is example for you.

If I put in A1 as 10, it should shade 10 rows in B column. i.e. B1 to B10. Next if i put in A11 as 2, it should shade only 2 rows in B column. i.e B11 to B12. How to do this using conditional formatting.

Thanks in advance

Regards,
Vishwas K V
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
803
try this macro

Sub test()
Dim j As Integer, cadd As String, r As Range, r1 As Range

cadd = InputBox("type the cell where the numebr is entered. e.g. A1 or A11 etc")
Set r = Range(cadd)
j = r.Value
Set r1 = Range(r, r.Offset(j - 1, 0))
r1.EntireRow.Select

End Sub