return the value of the active column

K

Kelvin

Any Ideas???

How would you capture the value the active column in a variable?

=column() will give the value of the active column

How would I use a variable to capture that value. val = column() ????

I would appreciate any help

Thanks
 
R

Rick Rothstein \(MVP - VB\)

We are talking about in a macro, right? If I understand your question
correctly...

Val = ActiveCell.Column

Rick
 
K

Kelvin

Thanks , that seems to work , I am getting the value in the variable.

I am now getting an error in my vlookup when I use val instead of 33?
Any ideas?

Thanks again
 
R

Rick Rothstein \(MVP - VB\)

Sorry, I followed your lead and used the variable name you proposed in your
posting without paying attention to it. Val is a reserved key word in VBA
(there is a function by that name), so you can't use it as a variable name.
Just pick a different name and you should be okay.

Rick
 
Top