Simplify writing AutoHotkey code using the Macro recorder & Excel constants

Macro recorder & Excel constantsUsing the Macro recorder & Excel constants is a great way to obtain VBA code which is easily translated/tweaked to AutoHotkey syntax!

A lot of the time when I’m working on an AutoHotkey Script I can find great examples on the AutoHotkey Forum or Stack Overflow however sometimes I’m unable to find a similar example.  The below video demonstrates how you can use the Macro Recorder in Excel to help write your AutoHotkey syntax.  One very critical point you’ll need to remember is to “look up” the constant value by right clicking on it in the VBA mode and listing the “quick info”.

In addition to the 1,500+ constants in  this file, you can review this site which lists many of the constants

Video demonstrating the Macro recorder & Excel constants in Excel

Use Excel macro recorder to get constants from Excel for AutoHotkey

Setting Horizontal and Vertical Excel cell alignment with AutoHotkey

Excel cell alignment with AutoHotkey

Excel cell alignment with AutoHotkey

I love how easy it is to use AutoHotkey to set Excel formatting.   The below AutoHotkey syntax and video show how easy it is to set both vertical and horizontal alignment within Excel.  It also introduces the concepts of Excel Constants.

Video walking through Excel cell alignment with AutoHotkey

Setting Horizontal and Vertical Excel cell alignment with AutoHotkey

 

Obtain First, Last and # Used columns from Excel via AutoHotkey and COM

columns from Excel via AutoHotkey

Microsoft’s Component Object Model enables AutoHotkey to easily interact with Excel!  In the below video I used the following functions to obtain First, last and Used columns from Excel via AutoHotkey.  I also demonstrate a few additional functions which allow for easily converting letters to numbers and vice versa.  This makes it easier to program in Excel because you can reference “column M” instead of column 13.

Here are the functions which make it super easy to grab / set columns in Excel

 

Using AutoHotkey to get Columns from Excel via AutoHotkey

Using AutoHotkey to get Column information from Excel via AutoHotkey & COM

Obtain First row, Last row, # Used rows from Excel via AutoHotkey and COM

rows from Excel via AutoHotkeyBeing able to use AutoHotkey to automate Excel via COM is awesome!   In this video we walk through using these functions to obtain First row, Last row and # of used rows from Excel via AutoHotkey.

The below video demonstrates how easy it is to, programatically, obtain row information from the active worksheet.

Video walking through functions to obtain rows from Excel via AutoHotkey

Using AutoHotkey to get Row information from Excel via AutoHotkey & COM