VBA Examples

REDIM PRESERVEArrayReDim Preserve is the way to make a dynamic array and maintain the values currently stored in the array by using the ReDim Preserve VBA statement. If you want to resize your array while remembering all the elements in the array, you must use the Preserve keyword.
OUTLOOK AUTOMATIONAutomationExport Email to excel
WEB AUTOMATIONAutomationThis excel automatically download Job list to Excelsheet from different websites. The sheet has "Setting" page to determine each website configuration.
REFERENCEBindingAs a programmer, it’s a good practice to add references you need on the body of the codes rather than manually added to the application. This gives an assurance that the application always work whenever new implementation is done. There are 2 ways to add references in VBA
BINDINGBindingThe difference between EARLY Binding and LATE Binding.
CLASSClass ModuleExample of Class module implementation to populate Grade column.
COLLECTIONCollectionThe VBA Collection is a simple native data structure available in VBA to store (collect as you wish) objects. VBA Collections are more flexible than VBA Arrays as they are not limited in their size at any point in time and don’t require manual re-sizing. Collections are also useful when you don’t want to leverage there more complex (but quite similar) Data Structures like the VBA ArrayList or even a VBA Dictionary.
There are 2 ways to initiate collection: 1. SET NEW and 2. DIM NEW
STRANGE NUMBERMathFind any combination numbers that have the result contain all the numbers
LAST ROW AND COLUMNSheetThere are certain situations where we perform some tasks by finding last used Row with data in a Column. For examples, There may be many columns with data and each column may have different number of items (rows). In this situation we need to find exact number of rows in a specific column to avoid the unnecessary looping of all rows even if there is no data.
IMPORT FROM SQLConnectionThis macro imports stock daily data FINRA regsho (FINRA/NASDAQ TRF Carteret) from SQL server
EXPORT TO SQLConnectionThis macro exports stock daily data: FINRA regsho (FINRA/NASDAQ TRF Carteret) to SQL server