Created
November 8, 2013 13:39
-
-
Save fdeitelhoff/7371165 to your computer and use it in GitHub Desktop.
Calculate birthdays and visualize them in the 170 x 170 area of the Excel 2013 workbook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void CalculateBirthdays(int rows, int columns) | |
{ | |
var days = 1; | |
var years = 1; | |
for (var row = 1; row <= rows; row++) | |
{ | |
for (var column = 1; column <= columns; column++) | |
{ | |
var cell = Cells[row, column] as Range; | |
if (cell != null && days % 365 == 0) | |
{ | |
cell.Interior.Color = Color.Green; | |
Cells[row, column] = years; | |
years++; | |
} | |
days++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment