Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get the number of the actual column in a range it belongs to 2

Status
Not open for further replies.

joaopazevedo

Technical User
Feb 3, 2012
5
PT
Hi, Thank you for your time

Wanted to know how to get the number of the actual column in reference to a range it belongs to, not to the absolute excel reference of columns.
 
=COLUMN(<where your at>)-COLUMN(<where your reference point is>)

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
After reading I said, Haaa
It's obvious. But only obvious if you think of it.
Thank you very much
 

hi,
the number of the actual column in reference to a range it belongs to
Code:
  With Range(TheRange)
    msgbox "The FIRST column in SomeRange is " & .column
    msgbox "The LAST column in SomeRange is " & .column + Columns.Count -1
    msgbox "The NUMBER OF COLUMNS in SomeRange is " & .columns.count

  End with


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top