VB Code line for determining column

  • Thread starter Thread starter k483
  • Start date Start date
K

k483

What's the correct syntax for a VB code line that returns the
current column (or row)?

For example
If Worksheets("currentsheet").column=1 then ' is the curren
column A?
End if

Thank
 
Im bit confuse about your post.


MsgBox ActiveCell.Row ' ' gives you the row number
MsgBox ActiveCell.Column ' gives you the column number a =1 b =2 ... etc

MsgBox Split(ActiveCell.Address, "$")(1) ''For Column Letter ' will get
you the column letter.





Hope it helps
 
Hi,

A couple...

If ActiveCell.Column = 1 Then

If Selection.Column = 1 Then

jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top