Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting a non-empty range of cells
The very useful short-cut keystroke CTRL-SHIFT and DOWN/UP selects a range of cells with data in it. How can this action be repeated in a macro? (Record_Macro returns the absolute range). I need to return a cell count to manipulate data associated with this selected range. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting a non-empty range of cells
Hi!
Sub SelectionUp() Range(ActiveCell, ActiveCell.End(xlUp)).Select End Sub Sub SelectionDown() Range(ActiveCell, ActiveCell.End(xlDown)).Select End Sub Starwing "Mourinho" a écrit dans le message de ... The very useful short-cut keystroke CTRL-SHIFT and DOWN/UP selects a range of cells with data in it. How can this action be repeated in a macro? (Record_Macro returns the absolute range). I need to return a cell count to manipulate data associated with this selected range. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting a non-empty range of cells
Thanks
Though am getting an error when attempting this..xlRight Is this an incorrect method? (see below) M Sub CountMonth() ' Returns Run Length and No.of Columns in RSM file Dim CntMon Dim CntRsm ActiveSheet.Range("B7").Select Range(ActiveCell, ActiveCell.End(xlDown)).Select CntMon = Selection.Count ERROR Range(ActiveCell, ActiveCell.End(xlRight)).Select ERROR CntRsm = Selection.Count End Sub "Starwing" wrote: Hi! Sub SelectionUp() Range(ActiveCell, ActiveCell.End(xlUp)).Select End Sub Sub SelectionDown() Range(ActiveCell, ActiveCell.End(xlDown)).Select End Sub Starwing "Mourinho" a écrit dans le message de ... The very useful short-cut keystroke CTRL-SHIFT and DOWN/UP selects a range of cells with data in it. How can this action be repeated in a macro? (Record_Macro returns the absolute range). I need to return a cell count to manipulate data associated with this selected range. Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
selecting a non-empty range of cells
Mourinho,
Not xlRight, but xlToRight, xlToLeft,xlUp,xlDown. Jorge "Mourinho" escreveu na mensagem ... Thanks Though am getting an error when attempting this..xlRight Is this an incorrect method? (see below) M Sub CountMonth() ' Returns Run Length and No.of Columns in RSM file Dim CntMon Dim CntRsm ActiveSheet.Range("B7").Select Range(ActiveCell, ActiveCell.End(xlDown)).Select CntMon = Selection.Count ERROR Range(ActiveCell, ActiveCell.End(xlRight)).Select ERROR CntRsm = Selection.Count End Sub "Starwing" wrote: Hi! Sub SelectionUp() Range(ActiveCell, ActiveCell.End(xlUp)).Select End Sub Sub SelectionDown() Range(ActiveCell, ActiveCell.End(xlDown)).Select End Sub Starwing "Mourinho" a écrit dans le message de ... The very useful short-cut keystroke CTRL-SHIFT and DOWN/UP selects a range of cells with data in it. How can this action be repeated in a macro? (Record_Macro returns the absolute range). I need to return a cell count to manipulate data associated with this selected range. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting data €“ when some cells are empty | Excel Discussion (Misc queries) | |||
Selecting a range of cells, how to ? | Excel Worksheet Functions | |||
Selecting a Range of cells in VBA | Excel Programming | |||
Selecting Contiguous data that contains many empty cells | Excel Programming | |||
Selecting a range of cells | Excel Programming |