• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Colour code with count

Nabeel

Member
good day all

PFA, i want color code of each 190 cells equally in sheet pl make that should ask for count, if give 190 then equally color and if i give 100 then similarly...! i have make sample also in sheet with color


Nabeel
 

Attachments

good day all

PFA, i want color code of each 190 cells equally in sheet pl make that should ask for count, if give 190 then equally color and if i give 100 then similarly...! i have make sample also in sheet with color


Nabeel
Hi,

Please try the following and let me know if it works for you
Code:
Sub test()

    Dim n, i As Integer
 
    n = InputBox("Number of subscribers", "Set background color")
 
    If n = vbNullString Then
        Exit Sub
    Else
        For i = 1 To Round(Columns("A").Cells(Rows.Count).End(xlUp).Row / n, 0)
            Range("A" & (2 + n * i - n) & ":A" & (n * i + 1)).Interior.ColorIndex = i + 2
        Next i
    End If

End Sub

Hope it helps
 
Back
Top