Skip to content

Exercises in Visual Basic for Microsoft Excel.

Notifications You must be signed in to change notification settings

heracliteanflux/exercises-vba

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Excel & VBA

Exercises in VBA for Microsoft Excel.

Excel

Documentation

Installation

Excel help & learning

colors

Excel & Python

[ d ][ g ] Python in Excel

  • [ b ] Microsoft Excel. (22 Aug 2023). "Announcing Python in Excel: Combining the power of Python and the flexibility of Excel".
  • [ b ] Anaconda. "The Versatility of Excel + The Power of Anaconda".

[ h ] Zurnstein, Felix. (2021). Python for Excel: A Modern Environment for Automation and Data Analysis. O'Reilly.

VBA

Documentation

Language reference for Visual Basic for Applications (VBA)

Getting started with VBA in Office

Concepts (Excel VBA reference)

[ d ] VBA for Excel

  • [ d ] Range object
    • [ d ] Range.AutoFit method
    • [ d ] Range.Count property
    • [ d ] Range.End property
    • [ d ] Range.NumberFormat property
      • [ d ] Number format codes
    • [ d ] Range.NumberFormatLocal property
    • [ d ] Range.Row property
    • [ d ] Range.Style property
  • [ d ] Sheets object
  • [ d ] Style object
  • [ d ] Styles object
  • [ d ] WorksheetFunction.Match method
  • [ d ] Worksheet objet
    • [ d ] Worksheet.Name property
  • [ d ] Worksheets object

data types

  • [ d ] Currency

[ d ] Error messages

  • [ d ] Error 009 Subscript out of range
  • [ d ] Error 013 Type mismatch
  • [ d ] Error 450 Wrong number of arguments

Terms

  • [ w ] Basic
  • [ w ] Cell
  • [ w ] Column Label
  • [ w ] Conditional Formatting
  • [ w ] Filter
  • [ w ] Formula
  • [ w ] Freeze
  • [ w ] Function
  • [ w ] Macro
  • [ w ] Microsoft Excel
  • [ w ] Microsoft Office
  • [ w ] Module
  • [ w ] Pane
  • [ w ] Pivot Chart
  • [ w ] Pivot Table
  • [ w ] Row Index
  • [ w ] Sheet
  • [ w ] Spreadsheet
  • [ w ] Subroutine
  • [ w ] Tablular Data
  • [ w ] VBScript
  • [ w ] VB Visual Basic
  • [ w ] VB .NET
  • [ w ] VBA Visual Basic for Applications
  • [ w ] Worksheet

Notes

.xlsx Excel Workbook .xlsm Excel Workbook (macro-enabled)

Module (right-click > "Insert" > "Module")

  • an organizational unit of VBA code that's usually attached to a workbook or worksheet

Specify cells of a spreadsheet

  • Cells(<row>, <col>) numeric, coordinate-based
    • Cells(1, 1) designates row 1, col 1
  • Ranges
    • F5:F7 contiguous
    • R2,D2 noncontiguous
  • .Value

clears

  • .Clear
  • .ClearContents
  • .ClearFormats
  • ActiveSheet.UsedRange.Delete
  • Sheets("Sheet1").Cells.Clear

Comments '

Variable Declaration Dim <name> As <type>

Types

  • Double
  • Integer
  • String
    • Split

Cast

  • int to string Str()
  • string to int Int()

Arrays

  • zero-indexed

Conditionals If Then End If ElseIf Else And Or For Each