Tagged: Coding Pattern

Specify PtrSafe to use both 32bit and 64bit Excel when importing Windows API

Learn about the Windows API PtrSafe declaration. When coding with Excel VBA, you can check the causes and solutions of PtrSafe-related errors that you occasionally encounter while importing and using Windows APIs. 1. Example code for Windows API PtrSafe error This is the code that imports and declares Windows API Sleep, OutputDebugString. (reference:...

VBA Coding Patterns: Improving VBA Performance

In this article, we will look at how to improve VBA performance. In the previous article, we compared the VBA Range Loop method and confirmed that the method using Variant Array is the fastest. VBA Coding Pattern: Range Loop - Read 1. Performance-Related VBA Global Variables Here is a summary of all variables....

VBA Coding Pattern: Named Range

Even if the reference address of Range is changed during VBA coding, if you use Named Range (named range), you can prevent the source code from changing regardless of the reference address change. Let's look at the following. 1. Range reference using absolute address The most frequently used method among many methods to refer to a Range in Excel VBA is as follows. In Range(“B2”)...

VBA Coding Pattern: Range Loop - Write

Among the VBA coding patterns, look at the contents of Range Loop-Write. Summary Introducing coding patterns that improve performance when writing a lot of data in an Excel sheet using Variant Array. The article below has already covered how to improve performance when reading a lot of data from an Excel sheet. VBA coding patterns:...

VBA Coding Pattern: Range Loop - Read

Among the VBA coding patterns, look at the contents of Range Loop-Read. Summary Range Loop is a coding pattern often used when reading and processing data entered in an Excel sheet with VBA code. The basic pattern of reading sequentially from the start cell to the last cell, and reading at once without reading sequentially...

en_USEnglish