Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In Excel, the keystrokes Shift+End+Arrow(any direction) selects the data from
the cell where the keystroke was invoked to the end of the data (in whichever direction was indicated). I used these keystrokes to create a macro to select data in a particular column. It worked fine on my test file. However, if I use that same macro on a file with a different number of data rows, the macro does not make the selection in the same manner. Whatever cells were selected on the recording is what is included in the macro coding. Is there a way to edit the macro where it will mimic the Shift+End+Arrow keystrokes? I want to select the data in a column, not a specific hard-coded cell range. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This selects the activecell to the last used cell in that column:
with activesheet .range(activecell, .cells(.rows.count,activecell.column).end(xlup)).s elect end with smokief wrote: In Excel, the keystrokes Shift+End+Arrow(any direction) selects the data from the cell where the keystroke was invoked to the end of the data (in whichever direction was indicated). I used these keystrokes to create a macro to select data in a particular column. It worked fine on my test file. However, if I use that same macro on a file with a different number of data rows, the macro does not make the selection in the same manner. Whatever cells were selected on the recording is what is included in the macro coding. Is there a way to edit the macro where it will mimic the Shift+End+Arrow keystrokes? I want to select the data in a column, not a specific hard-coded cell range. -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub select_alldown()
'select to bottom of selected column(s) Set myRange = Range(Selection, Cells(Rows.Count, Selection.Column).End(xlUp)) MsgBox "Range selected is " & myRange.Address End Sub Gord Dibben MS Excel MVP On Thu, 3 May 2007 11:08:01 -0700, smokief wrote: In Excel, the keystrokes Shift+End+Arrow(any direction) selects the data from the cell where the keystroke was invoked to the end of the data (in whichever direction was indicated). I used these keystrokes to create a macro to select data in a particular column. It worked fine on my test file. However, if I use that same macro on a file with a different number of data rows, the macro does not make the selection in the same manner. Whatever cells were selected on the recording is what is included in the macro coding. Is there a way to edit the macro where it will mimic the Shift+End+Arrow keystrokes? I want to select the data in a column, not a specific hard-coded cell range. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I select a range using a macro? | Excel Discussion (Misc queries) | |||
Using macro to select a range | Excel Worksheet Functions | |||
select a range in a macro | Excel Discussion (Misc queries) | |||
Macro €“ select all cells in current range | Excel Discussion (Misc queries) | |||
How can I vary graph color by range value | Charts and Charting in Excel |