• 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.

If statement, for cell-Meaning?

If row = reason_count + 24 Then
Cells(row, 5).Borders(xlEdgeTop).LineStyle = xlContinuous
ElseIf row = 2 * reason_count + 23
Cells(row, 5).Borders(xlEdgeBottom).LineStyle = xlContinuous
EndIf
If Int((row - reason_count - 24) / 5) Mod 2 = 0 Then
Cells(row, 5).Interior.Color = 12632256
EndIf
 
Code:
If row = reason_count + 24 Then  'If the row variable is equal to reason_count variable + 24, do this....
        Cells(row, 5).Borders(xlEdgeTop).LineStyle = xlContinuous 'Top border is solid
ElseIf row = 2  reason_count + 23  Then  'If first If statement was false, check if row variable = 2reason_count variable + 23
        Cells(row, 5).Borders(xlEdgeBottom).LineStyle = xlContinuous  'Bottom cell border becomes solid
End If
If Int((row - reason_count - 24) / 5) Mod 2 = 0 Then  'I explained this already in one of your other threads, basically counting every group of 5 rows
Cells(row, 5).Interior.Color = 12632256  'Set the cell background. Looks like this is overall just shading every 5 rows a different color
End If
 
Back
Top