Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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
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
Selecting data €“ when some cells are empty Flemming Excel Discussion (Misc queries) 0 November 19th 07 11:18 AM
Selecting a range of cells, how to ? Luc Excel Worksheet Functions 2 February 23rd 07 07:17 PM
Selecting a Range of cells in VBA spacecityguy[_4_] Excel Programming 3 August 30th 04 04:14 PM
Selecting Contiguous data that contains many empty cells Rodrigo[_3_] Excel Programming 1 February 24th 04 07:23 PM
Selecting a range of cells Kevin Excel Programming 5 October 10th 03 03:03 PM


All times are GMT +1. The time now is 01:39 PM.

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"