MrExcel Publishing
Your One Stop for Excel Tips & Solutions

column() function in vba


Posted by Peter on December 11, 2001 9:18 AM

Hi,

How can I make the return value of a function depend on the cell location where is function is written in. For example, in Excel I can use the function COLUMN() to get the column number of the cell where the function is written in. How can I do the same in VBA?

Thanks


Posted by Barrie Davidson on December 11, 2001 10:17 AM

Peter, you can use something like this to return the active cell's column number.

ActiveCell.Column

Regards,
BarrieBarrie Davidson