As ever, you use this free program at your own risk.
Feel free to use the free software on this site but please honor the copyright.
FindColumn is an Excel™ VBA Function that will look for the first
occurrence of the passed string in a column and return the column number.
There are three possible parameters, the first one is required the others are
optional.
These parameters are:
- (Required) The string to be searched for.
- (Optional) The worksheet to be searched. If omitted then "Dashboard" will
be used.
- (Optional) True or False. This tells FindColumn
whether a partial match is allowed or not.
The default is False so the entire string must match the entire
column contents (xlWhole used). True would
allow a partial match (xlPart used).
To illustrate the use of FindColumn we will use the following worksheet
named "Demo".

Using the above worksheet the following code would return value of
4
(i.e the first column with the word "Value" in it)
FindColumn("Value", "Demo", True)
However coding:
FindColumn("Value", "Demo", False)
would return a value of 0 as no
column contains only the word "Value".
if, however you code:
FindColumn("Value", "Book Demo", False)
a value of 5 will be returned.
FindColumn will find the text in any row, not just the first, for example:
FindColumn("Eisenhower", "Demo")
will return a value of 6.
Note:
FindColumnrequires the subroutine WorksheetExtant to be available.
Link
|
Description |
|
|
|
|
This link will take you
to the source code for FindColumn.
As FindColumn calls WorkSheetExtant you will need to download it
and place it in the same workbook.
|
|
|
|
This link will take you
to the source code for WorkSheetExtant.
|
|
If you need any support or assistance with any of the code on this site
or
if you would just like to contact us, please
click here
Follow us on Facebook