Maybe for some reason we want to change our Microsoft Excel Status Bar, then this simple vba function will do the work for us.
The end result will look like this:
Ok, to do it, put this following code in ThisWorkbook code
Private Sub Workbook_Open()
‘when workbook opened, change the status bar
[...]
Tags: excel status bar, status bar, vba function, vba macro
Imagine this condition; We are in the middle of doing something using Excel VBA macro, then we want the macro to automatically show the File Open dialog box to make us (user) able to choose another Excel file to be opened by Excel.
Got the picture? Below is vba procedure that do exactly like that, show [...]
Tags: Dialog Box, excel macro open excel file, excel macro open file, excel macro to open a file, excel open file macro, excel vba open file, macro excel open file, macro open file, macro to open a file, macro to open excel file, Open File, open file macro, open file macro excel, vba macro open file
Usually in the sequential database system, we can SUM only unique values in table column by adding all the values from SELECT DISTINCT query result only.
Based on the same principle, we can also create a simple VBA function in Microsoft Excel by adding the values only available in a collection of unique values we have [...]
The function below will allow us to remove a non alphanumeric character from an input string.
Be careful though, lengther the string, more time needed to evaluate each string on the sentence.
To bad that I don’t have any idea on how to use Regular Expression in Excel VBA, if we can use regex to replace [...]
Tags: alphanumeric, string
Auto run macro excel… Do you want to run an excel macros automatically when the file is open or close?
Microsoft Excel provide us the opportunity to run a macro automatically every time we open or close the excel workbook file, using the event Workbook_Open and Workbook_BeforeClose.
In the Microsoft Visual Basic Editor page, in the ThisWorkbook module, we simply [...]
Tags: auto run macro excel, autorun macro excel, excel autorun macro, run excel macro automatically
We can get an input from user using Input Box, but we also can use the Input Box to get the address of cell reference in Microsoft Excel.
Using simple Excel VBA procedure below we can ask user to select range of cells (as copy input) and where they want it paste.
Sub CopyPaste()
Dim InputCells As Excel.Range
Dim [...]
Tags: Copy, excel vba input box, excel vba inputbox, Input Box, input box vba, input range vba, Paste, vba input range
Let say I have a bunch of formatted data in my Excel sheet, and in Column A I have a dates. Then I wanna filter all the data base on certain date, for example 1 Jan 2009, and delete all others data before that date.
The algorithm is like this: I’ll create a loop from the [...]
Tags: columns, delete row, excel macro, excel macro delete row, excel vba delete row, filtered date, function cells, vba delete excel row
Ok, this time I want to talk about how to create a vlookup table array that automatically expanding in accordance with the numbers of available data.
As we know, the basic form of Excel VLOOKUP to look for A1 value in range B1:C15 column no 2 is like this:
=VLOOKUP(A1,B1:C15,2)
With parameters such as the value we looking [...]
Tags: excel 2003 vlookup, excel formulas vlookup, excel vba vlookup, excel vlookup table array, lookup table, microsoft excel vlookup, vlookup array formula, vlookup excel vba, vlookup pivot tables, vlookup VBA macro
Ceiling, or changing a specific decimal number into become its upper number, for example if we ceiling 3.25 we will got 4, or if we ceiling 2.75 then we will got 3 as a result.
To get a result like that in Microsoft Excel, we can simply use this very simple but neat Excel VBA function
Function [...]
Tags: ceiling vba, excel vba ceiling, Excel VBA Function, vba ceil, vba ceiling, vba ceiling function
If you read my latest update on how we can get position of last row containing data, then most probably you already have a glimpse on how we perform the same task with last column containing data in Excel.
The VBA code is the exact replica of the code to get the last row, only [...]
Tags: excel vba, excel vba find last column, excel vba last column, vba column, vba excel last column, vba get last column, vba last column, vba tutorial
A few weeks ago I received this question from someone called LS:
Hi
I want to write a macro that counts the following
- Number of cells with formula
- Number of Rows with formula
- Number of Columns with formula
Please let me know if there is a way of doing it in Excel VBA
To find out the number of [...]
Tags: cells, columns, excel cells, excel formula, excel macro count rows, excel macro count the no of rows with text, excel vba count rows, rows, vba count rows, vba macro, worksheet cells
I once asked by Joshuacht about how to make a macro running every 15 minutes. Let say because every 15 minutes we have to refresh or reload the data in the Workbook.
Below is a sample of how we can do this in Microsoft Excel *just an outline*.
The logic is simple, when we open the [...]
Tags: application.ontime, data refresh, excel macro refresh data, excel vba refresh external data, function refresh, run macro automatically, vba refresh data