Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Limiting selection in a cell AND linking that selection to a list | Excel Discussion (Misc queries) | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
Change from Column Selection to Cell Selection | Excel Programming | |||
Object Type of a selection... counting rows in a selection | Excel Programming | |||
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. | Excel Programming |