This entry is just for myself in case I forgot what I wrote for my VBA assignment. I was asked to create a chess board in Microsoft using VBA. I admit I googled the solution but all I found was a solution that used "MOD". My professor didn't teach us how to use "MOD", which meant I couldn't use that code. Anyway, this is what I came up with. Sub Chess() For a = 1 To 8 Cells(a, 1).Offset(0, a - 1).Interior.Color = black Next a For b = 3 To 8 Cells(b, 1).Offset(0, b - 3).Interior.Color = black Next b For c = 5 To 8 Cells(c, 1).Offset(0, c - 5).Interior.Color = black Next c For d = 7 To 8 Cells(d, 1).Offset(0, d - 7).Interior.Color = black Next d For e = 1 To 6 Cells(e, 3).Offset(0, e - 1).Interior.Color = black Next e For f = 1 To 4 Cells(f, 5).Offset(0, f - 1).Interior.Color = black Next f For g = 1 To 2 Cells(g, 7).Offset(0, g - 1).Interior.Color = black Next g End Sub Cheers, MNS
Since January 2nd, I have seen all the stores decoration turning from new year theme to valentines' day theme. For one month, I successfully stopped myself from buying any sweet treats. Well, it's not like there is someone special to buy me such things. haha Anyway, I convince myself that I'm happily single. Well, am I? I don't know. I just know that I am very content with my life right now. Happy Pre-Single's Awareness Day, people! -- MNS
Comments
Post a Comment