ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   (xlDown) not working properly! (https://www.excelbanter.com/excel-programming/284796-xldown-not-working-properly.html)

aapp81[_25_]

(xlDown) not working properly!
 

i have columns A2:T2 selected and then i do this:
Range(Selection, Selection.End(xlDown)).Select
but it only selects up to the last row in column T but other cols ar
longer...
is there anyway to fix this so that it selects down to the longest col

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements

Dick Kusleika[_3_]

(xlDown) not working properly!
 
aapp81

It should select down to the last value in column A, not T. Anyway, try
this

Selection.CurrentRegion.Select

and see if that doesn't give you the proper range.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"aapp81" wrote in message
...

i have columns A2:T2 selected and then i do this:
Range(Selection, Selection.End(xlDown)).Select
but it only selects up to the last row in column T but other cols are
longer...
is there anyway to fix this so that it selects down to the longest col?


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements



aapp81[_27_]

(xlDown) not working properly!
 

Dick Kusleika wrote:
*aapp81

It should select down to the last value in column A, not T. Anyway
try
this

Selection.CurrentRegion.Select

and see if that doesn't give you the proper range.
*


yeah, i thought about doing that but i have headings in A1:T1 and doin
"currentregion" selects them as well... and i want it to start fro
row

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements

Tom Ogilvy

(xlDown) not working properly!
 
set rng = selection.CurrentRegion
if rng.row = 1 then _
set rng = rng.offset(1,0).Resize(rng.rows.count-1)

rng.Select

--
Regards,
Tom Ogilvy


"aapp81" wrote in message
...

Dick Kusleika wrote:
*aapp81

It should select down to the last value in column A, not T. Anyway,
try
this

Selection.CurrentRegion.Select

and see if that doesn't give you the proper range.
*


yeah, i thought about doing that but i have headings in A1:T1 and doing
"currentregion" selects them as well... and i want it to start from
row2


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements



aapp81[_28_]

(xlDown) not working properly!
 

thank you very much!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements

Vic Eldridge

(xlDown) not working properly!
 
Here's one way...

With Selection
.Resize(.CurrentRegion.Rows.Count - .Row + 1, _
.CurrentRegion.Columns.Count).Select
End With


Regards,
Vic Eldridge


aapp81 wrote in message ...
i have columns A2:T2 selected and then i do this:
Range(Selection, Selection.End(xlDown)).Select
but it only selects up to the last row in column T but other cols are
longer...
is there anyway to fix this so that it selects down to the longest col?


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements


Vasant Nanavati

(xlDown) not working properly!
 
Hey Vic ... long time no see!

Regards,

Vasant.

"Vic Eldridge" wrote in message
m...
Here's one way...

With Selection
.Resize(.CurrentRegion.Rows.Count - .Row + 1, _
.CurrentRegion.Columns.Count).Select
End With


Regards,
Vic Eldridge


aapp81 wrote in message

...
i have columns A2:T2 selected and then i do this:
Range(Selection, Selection.End(xlDown)).Select
but it only selects up to the last row in column T but other cols are
longer...
is there anyway to fix this so that it selects down to the longest col?


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements



Vic Eldridge

(xlDown) not working properly!
 
Hey Vic ... long time no see!

Regards,

Vasant.



Howdy Vasant.

Yeah it's been a while. I wonder how many Application.ScreenUpdating
= False's I missed out on. ;-)

I see you've been crowned an MVP. Well Done !


Regards,
Vic Eldridge


All times are GMT +1. The time now is 04:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com