How to write Excel Macros (VBA)
Written By: admin on March 6, 2010
8 Comments
Watch this video tutorial to understand the creation of macros in Excel using VBA.
Watch this video tutorial to understand the creation of macros in Excel using VBA.
clearly you are teaching graduate students… as an amateur excel user I didnt understand an iota of what you taught.
Thanks, this is great. And you speak English which is a plus.
stai leggendo la catena di osiris..un demone si è impossessato di una bambina se non scrivi questo messagio in altri 5 video in tre minuti la bambina/demone stara nella tua stanza stanotte (Scusate ma l’hanno fatto a me perciò…)
Try this
Sub checkers()
boardsize = 13
For i = 1 To boardsize
For j = 1 To boardsize
If (i + j) Mod 2 = 0 Then
Cells(i, j).Interior.ColorIndex = 3
Else
Cells(i, j).Interior.ColorIndex = 1
End If
Next
Next
End Sub
checker = 0
For Each thing In Selection
checker = 1 – checker
thing.Value = checker
Next
End Sub
This is the code I made for a checkerboard, in the speadsheet, it looks like 1′s and 0′s. I need away to incorporate Red (colorindex 3) instead of the number 1. And replace Black (colorindex 1) instead of the number 0. I want to make a red and black checkerboard on the spreadsheet. How can I replace the number code with the color code formula?
That didn’t format well. It should be more like this
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
End With
One way to get color in a cell is:
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
End With
This is yellow.
how can I change 1′s and 0′s to Red and Black in the macro module?
This is the code I made for looping a checkerboard design,
checker = 0
For Each thing In Selection
checker = 1 – checker
thing.Value = checker
Next
End Sub
how can i convert numbers into colors from the module sheet?