Change Player Size
Watch this video in a new window

Introduction to Writing Excel Macros (VBA)

This video introduces the creation of macros in Excel using VBA. The intro is oriented towards engineers and is part of a course I teach in an online Masters program. The program is described at ht...  
 
Customize

More From: jakeblanchard

Loading...

QuickList(0)

Upgrade to Flash Player 10 for improved playback performance. Upgrade Now or get more info.
46 ratings
Sign in to rate
113,109 views
Want to add to Favorites? Sign In or Sign Up now!
Want to add to Playlists? Sign In or Sign Up now!
Want to flag a video? Sign In or Sign Up now!

Statistics & Data

Loading...

Video Responses (1)

Sign in to post a Comment

Text Comments (4)   Options

Loading...
Comment(s) marked as spam Show
runningthunder24 (1 year ago) Show Hide
 0
Marked as spam
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?
jakeUWMadison (1 year ago) Show Hide
 0
Marked as spam
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
runningthunder24 (1 year ago) Show Hide
 0
Marked as spam
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?
jakeblanchard (1 year ago) Show Hide
Marked as spam
One way to get color in a cell is: With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .Color = 65535 End With

This is yellow.
jakeblanchard (1 year ago) Show Hide
Marked as spam
That didn't format well. It should be more like this

With Selection.Interior

.Pattern = xlSolid

.PatternColorIndex = xlAutomatic

.Color = 65535

End With

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.