#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Selection

I want to select columnes from C to unknown.
Thus, I want to define it like following:

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select

However, it doesn't work properly, The result is

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Thus, I record the macro and replay it. However, also doesn't work.
Sometimes, it works, and suddenly it doesn't work. and that's now. It
makes me crazy !
Is there some setting for using this? Or is there other method?
I always appreciate peoples answer from here! It's really really
helpful!!!!!
Thx.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Selection

Maybe play around with the CurrentRegion property

Range("C1").Activate
ActiveCell.CurrentRegion.Select

See how you go with that.

Greg

kirke wrote:
I want to select columnes from C to unknown.
Thus, I want to define it like following:

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select

However, it doesn't work properly, The result is

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Thus, I record the macro and replay it. However, also doesn't work.
Sometimes, it works, and suddenly it doesn't work. and that's now. It
makes me crazy !
Is there some setting for using this? Or is there other method?
I always appreciate peoples answer from here! It's really really
helpful!!!!!
Thx.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Selection

Yes. It works.
However, I miss something. I have another data on column A and B which
don't want to be selected.
Thx.


Greg Glynn wrote:
Maybe play around with the CurrentRegion property

Range("C1").Activate
ActiveCell.CurrentRegion.Select

See how you go with that.

Greg

kirke wrote:
I want to select columnes from C to unknown.
Thus, I want to define it like following:

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select

However, it doesn't work properly, The result is

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Thus, I record the macro and replay it. However, also doesn't work.
Sometimes, it works, and suddenly it doesn't work. and that's now. It
makes me crazy !
Is there some setting for using this? Or is there other method?
I always appreciate peoples answer from here! It's really really
helpful!!!!!
Thx.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Selection

Range("C1", Range("C1").End(xlToRight).End(xlDown).End(xlDown) ).Select

--
Festina Lente


"kirke" wrote:

I want to select columnes from C to unknown.
Thus, I want to define it like following:

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select

However, it doesn't work properly, The result is

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Thus, I record the macro and replay it. However, also doesn't work.
Sometimes, it works, and suddenly it doesn't work. and that's now. It
makes me crazy !
Is there some setting for using this? Or is there other method?
I always appreciate peoples answer from here! It's really really
helpful!!!!!
Thx.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Selection

Thx! This perfectly work!

Well then, don't you the reason know why mine doesn't work? it looks
similar with yours~~


PapaDos wrote:
Range("C1", Range("C1").End(xlToRight).End(xlDown).End(xlDown) ).Select

--
Festina Lente


"kirke" wrote:

I want to select columnes from C to unknown.
Thus, I want to define it like following:

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select

However, it doesn't work properly, The result is

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Thus, I record the macro and replay it. However, also doesn't work.
Sometimes, it works, and suddenly it doesn't work. and that's now. It
makes me crazy !
Is there some setting for using this? Or is there other method?
I always appreciate peoples answer from here! It's really really
helpful!!!!!
Thx.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Selection

try using usedRane. You can read about it more in help section.

Worksheets("Sheet1").Activate
ActiveSheet.UsedRange.Select


kirke wrote:
Thx! This perfectly work!

Well then, don't you the reason know why mine doesn't work? it looks
similar with yours~~


PapaDos wrote:
Range("C1", Range("C1").End(xlToRight).End(xlDown).End(xlDown) ).Select

--
Festina Lente


"kirke" wrote:

I want to select columnes from C to unknown.
Thus, I want to define it like following:

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select

However, it doesn't work properly, The result is

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Thus, I record the macro and replay it. However, also doesn't work.
Sometimes, it works, and suddenly it doesn't work. and that's now. It
makes me crazy !
Is there some setting for using this? Or is there other method?
I always appreciate peoples answer from here! It's really really
helpful!!!!!
Thx.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Selection

Selection.End(xlDown) works from the first cell in the selected range...
--
Festina Lente


"kirke" wrote:

Thx! This perfectly work!

Well then, don't you the reason know why mine doesn't work? it looks
similar with yours~~


PapaDos wrote:
Range("C1", Range("C1").End(xlToRight).End(xlDown).End(xlDown) ).Select

--
Festina Lente


"kirke" wrote:

I want to select columnes from C to unknown.
Thus, I want to define it like following:

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select

However, it doesn't work properly, The result is

Range("C1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Thus, I record the macro and replay it. However, also doesn't work.
Sometimes, it works, and suddenly it doesn't work. and that's now. It
makes me crazy !
Is there some setting for using this? Or is there other method?
I always appreciate peoples answer from here! It's really really
helpful!!!!!
Thx.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Limiting selection in a cell AND linking that selection to a list Lisa Excel Discussion (Misc queries) 1 July 28th 09 05:00 PM
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Change from Column Selection to Cell Selection Lil Pun[_16_] Excel Programming 4 June 16th 06 10:38 PM
Object Type of a selection... counting rows in a selection Acid-Sky[_2_] Excel Programming 3 August 23rd 05 09:53 AM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM


All times are GMT +1. The time now is 12:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"