Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Calculate birthdays and visualize them in the 170 x 170 area of the Excel 2013 workbook.
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
You can’t perform that action at this time.