- Copy
A_Functions
to a new workbook - Copy
C_Pearson
to the same workbook - Add the following references:
- Microsoft Scripting Runtime
- Microsoft VBScript Regular Expressions 5.5
- Windows Script Host Object Model
- Change
VBAProject
totoolbelt
- Set version in Project Properties > Project Description
- Put the file in Dropbox > toolbelt
- Email subscribers to let them know about the update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub DeleteRowsWithAutofilter() | |
Dim wksData As Worksheet | |
Dim lngLastRow As Long | |
Dim rngData As Range | |
'Set references up-front | |
Set wksData = ThisWorkbook.Worksheets("data") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub DeleteRowsWithForLoop() | |
Dim wksData As Worksheet | |
Dim lngLastRow As Long, lngIdx As Long | |
'Set references up-front | |
Set wksData = ThisWorkbook.Worksheets("data") | |
With wksData |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub ConvertLookupsToValues() | |
Dim lngLastRow As Long, lngIdx As Long | |
Dim varLookups As Variant | |
'Everything happens on the Ledger sheet | |
With ThisWorkbook.Worksheets("Ledger") | |
'Identify the last-occupied row in column D on the Ledger sheet, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub ZipFoldersInColumn() | |
Dim wks As Worksheet | |
Dim lngIdx As Long, lngErrorCode | |
Dim strFullPath As String, strZipName As String, strEndFound As String, _ | |
strCommand As String, strTargetDir As String | |
Dim blnEndFound As Boolean | |
Dim wsh As WshShell | |
Set wsh = New WshShell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub RunBatchFileThenRenameFolder() | |
Dim strNewFolderName As String, strRunBatchCommand As String, _ | |
strRenameFolderCommand As String | |
Dim lngErrorCode As Long | |
Dim wks As Worksheet | |
Dim wsh As WshShell | |
Set wsh = New WshShell | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub RunBatchFile() | |
Dim strCommand As String | |
Dim lngErrorCode As Long | |
Dim wsh As WshShell | |
Set wsh = New WshShell | |
'Run the batch file using the WshShell object | |
strCommand = Chr(34) & _ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub MoveDataBasedOnDropDown() | |
Dim strInput As String, strPromptMessage As String | |
Dim wksAllocate As Worksheet, wksTarget As Worksheet | |
Dim obj As Object | |
Dim lngAllocateLastRow As Long, lngAllocateLastCol As Long, _ | |
lngTargetLastRow As Long | |
Dim rngAllocate As Range, rngTarget As Range | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Public Sub SaveSheetsAsPDF() | |
Dim wksAllSheets As Variant | |
Dim wksSheet1 As Worksheet | |
Dim strFilename As String, strFilepath As String | |
'Set references up-front | |
Set wksSheet1 = ThisWorkbook.Sheets("Sheet1") | |
wksAllSheets = Array("Sheet1", "Sheet2", "Sheet3") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
'This subroutine prompts the user to select dates | |
Public Sub PromptUserForInputDates() | |
Dim strStart As String, strEnd As String, strPromptMessage As String | |
'Prompt the user to input the start date | |
strStart = InputBox("Please enter the start date") | |