View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
papou[_4_] papou[_4_] is offline
external usenet poster
 
Posts: 110
Default Determining number of columns of 2 different ranges

Hi
May be this will do:
Dim colOne As Integer, colTwo As Integer
colOne = Cells(1, Mid(Left(Selection.Address, 2), 2, 1)).Column
colTwo = Cells(1, Left(Right(Selection.Address, 3), 1)).Column

MsgBox "First column = " & colOne & vbLf _
& "Second column = " & colTwo

HTH
Cordially
Pascal

"filo666" a écrit dans le message de
news: ...
I'm selecting two separate areas of my worksheet using Ctrl-Click(drag);
a1:a4 and c1:c4

I would like to know how to get the column number 1 for colum "A" and 3
for
colum "C".
pd, I'm not always using the same areas (it could be d1:d56 and g1:g7;
and
in this case I want 4 and 7 respectivly).

TIA