Column selection in VBA

tiguil

Board Regular
Joined
Jul 21, 2004
Messages
88
Let say that the cursor is positioned in cell b2. I would like to have a code that would recongnize the column in wich the cursor is positionned and woud select the range 21 to 200 of that column automaticaly. Can someone help me !!!
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

just_jon

Legend
Joined
Sep 3, 2002
Messages
10,473
tiguil said:
Let say that the cursor is positioned in cell b2. I would like to have a code that would recongnize the column in wich the cursor is positionned and woud select the range 21 to 200 of that column automaticaly. Can someone help me !!!

Try

Dim r as range
set r = Range(cells(21,selection.column),cells(200,selection.column))
 

Watch MrExcel Video

Forum statistics

Threads
1,118,018
Messages
5,569,646
Members
412,285
Latest member
Daibear
Top