View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
filo666 filo666 is offline
external usenet poster
 
Posts: 265
Default Selecting the secon column of a separate range

that is what I wanted to explain; what I want is the column number and not
the number of columns. (1 for the range a1:a4 and 3 for the range c1:c4.

Thanks

"JP" wrote:

Are you saying that you are selecting two separate areas of your
worksheet using Ctrl-Click(drag)?

If you highlight A1:A4 and C1:C4 and both are selected,
Selection.Areas.Count will give you the correct number (2).


HTH,
JP


On Jan 15, 9:47 am, filo666 wrote:
Hello, I'm working with graphs, what I want to do is a kind of difficult to
explain, I hope you understand what I'm trying to say.

I have The following data:

a b c d
1 Time Flow pressure permeate
2 1 3 40 .23
3 2 3.2 40.1 .24
4 3 3.2 40 .2

and so on

I press the control key in the cell A1 and I left clik and slide the pointer
from a1 to a4; then I stop pressing the left key of my mouse and go to the
cell c1 and presing the key control I repeat the same operation; then I have
a range composed by two different columns; wath I want VB to do is to tell me
the column number of the first and second selected columns (and thirt,
fourth, or any amount of columns selected)

I must mention that the ranges are allways from left to right and not at the
bottom (and all the ranges are allineated).

what I tried:

g = Selection.Columns.Count; it gives me the number 1 and that is wrong
because I have 2 columns (and I was expecting the value of column c=3).

the range is:

"a1:a4,c1:c4" and not "a1:c4"

I hope you understood.

TIA