A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Bill wrote:
Abosulute is not desired so I used this modification Address(False,False,,True) and miss the double comma ,, the i change it and it worked. But for future understanding what does THAT DO?
In VBA, put the cursor on the word Address, then press F1 to look at the help page.
You can pass VBA parameters by position, like most procedural programming languages, or by name.
If you look at the help page, you will see that the 1st, 2nd and 4th arguments correspond to the parameters RowAbsolute, ColumnAbsolute and External. These are booleans -- True or False.
By default, External is False. Setting it to True returns the address with the file and worksheet name. Excel ignores the file name when it is the same the cell where the formula is stored.
By default, RowAbsolute and ColumnAbsolute are True, which is why Address was returning absolute references. Setting them both to False returns relative references.
I cannot imagine why it would matter to you, unless you intend to copy the formula down the column. But if that's the case, you might as well allow the macro to do the work in one step.
I thought you might overlook the double comma, which takes the default for the 3rd parameter. That is one reason why I provided the by-name alternative. Also, some people prefer the self-documenting style.