Home » Office

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.

Digg this!Add to del.icio.us!Stumble this!Add to Techorati!Share on Facebook!Seed Newsvine!Reddit!

8 Responses to “How to write Excel Macros (VBA)”

  1. whatever3009 on: 6 March 2010 at 10:01 pm

    clearly you are teaching graduate students… as an amateur excel user I didnt understand an iota of what you taught.

  2. eadaaf on: 6 March 2010 at 10:18 pm

    Thanks, this is great. And you speak English which is a plus.

  3. zukkerinafragolina on: 6 March 2010 at 10:42 pm

    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ò…)

  4. jakeUWMadison on: 6 March 2010 at 11:28 pm

    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

  5. runningthunder24 on: 7 March 2010 at 12:14 am

    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?

  6. jakeblanchard on: 7 March 2010 at 12:36 am

    That didn’t format well. It should be more like this

    With Selection.Interior

    .Pattern = xlSolid

    .PatternColorIndex = xlAutomatic

    .Color = 65535

    End With

  7. jakeblanchard on: 7 March 2010 at 12:52 am

    One way to get color in a cell is:

    With Selection.Interior
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    .Color = 65535
    End With

    This is yellow.

  8. runningthunder24 on: 7 March 2010 at 1:50 am

    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?

Leave a Reply:

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  Copyright ©2009-2010 Best Indian Bloggers, All rights reserved.| WPElegance2Col theme by Techblissonline.com