Determining what column a cell is in?
Determining what column a cell is in?
(OP)
Ok I have been looking through my vba books and have not found away to test an active cell for the column it's in.
I would like to determine a cells column then do an if statement giving a message box if the cell is in the wrong column.
Thanks for any help
I would like to determine a cells column then do an if statement giving a message box if the cell is in the wrong column.
Thanks for any help





RE: Determining what column a cell is in?
Col = Range(cell range).Offset(offset # of Rows, offset # of Colums).Column
You can probably clean it up to something similar to:
Col = Selection.Column
RE: Determining what column a cell is in?
Regards,
Regg
RE: Determining what column a cell is in?
If you really want the column letter you need to watch out for columns above 26:
Dim x
x = Split(ActiveCell.AddressLocal, "$")
MsgBox x(1)
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
UK steam enthusiasts: www.essexsteam.co.uk
RE: Determining what column a cell is in?
RE: Determining what column a cell is in?