Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Paul Ho
 
Posts: n/a
Default How many rows have I selected ?

Hi,

Any function that could tell me how many rows have I selected?
i.e. I have selected cells(A1:E5), the function could show me 5 row.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Norman Jones
 
Posts: n/a
Default How many rows have I selected ?

Hi Paul,

Assiming you are referring to VBA, try:

Dim NumOfRows As Long

NumOfRows = Selection.Rows.Count

---
Regards,
Norman


"Paul Ho" wrote in message
...
Hi,

Any function that could tell me how many rows have I selected?
i.e. I have selected cells(A1:E5), the function could show me 5 row.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Paul Ho
 
Posts: n/a
Default How many rows have I selected ?

Hi, Norman,

Thanks for you help. But I need is function, not VBA. Is it any?

Regards
Paul

"Norman Jones" wrote:

Hi Paul,

Assiming you are referring to VBA, try:

Dim NumOfRows As Long

NumOfRows = Selection.Rows.Count

---
Regards,
Norman


"Paul Ho" wrote in message
...
Hi,

Any function that could tell me how many rows have I selected?
i.e. I have selected cells(A1:E5), the function could show me 5 row.

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jerry W. Lewis
 
Posts: n/a
Default How many rows have I selected ?

There is no worksheet function for this. Take Norman's suggestion and
write it as a VBA User Defined Function

Function rowsSelected()
Application.Volatile
rowsSelected = Selection.Rows.Count
End Function

Declaring the the function to be volatile is necessary to get it to
recalculate in future recalculation events.

Jerry

Paul Ho wrote:

Hi, Norman,

Thanks for you help. But I need is function, not VBA. Is it any?

Regards
Paul

"Norman Jones" wrote:


Hi Paul,

Assiming you are referring to VBA, try:

Dim NumOfRows As Long

NumOfRows = Selection.Rows.Count

---
Regards,
Norman


"Paul Ho" wrote in message
...

Hi,

Any function that could tell me how many rows have I selected?
i.e. I have selected cells(A1:E5), the function could show me 5 row.

Thanks




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default How many rows have I selected ?

No, you can count the rows in a specified range, but not the selection.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Paul Ho" wrote in message
...
Hi, Norman,

Thanks for you help. But I need is function, not VBA. Is it any?

Regards
Paul

"Norman Jones" wrote:

Hi Paul,

Assiming you are referring to VBA, try:

Dim NumOfRows As Long

NumOfRows = Selection.Rows.Count

---
Regards,
Norman


"Paul Ho" wrote in message
...
Hi,

Any function that could tell me how many rows have I selected?
i.e. I have selected cells(A1:E5), the function could show me 5 row.

Thanks








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Paul Ho
 
Posts: n/a
Default How many rows have I selected ?

Thanks everybody!

"Jerry W. Lewis" wrote:

There is no worksheet function for this. Take Norman's suggestion and
write it as a VBA User Defined Function

Function rowsSelected()
Application.Volatile
rowsSelected = Selection.Rows.Count
End Function

Declaring the the function to be volatile is necessary to get it to
recalculate in future recalculation events.

Jerry

Paul Ho wrote:

Hi, Norman,

Thanks for you help. But I need is function, not VBA. Is it any?

Regards
Paul

"Norman Jones" wrote:


Hi Paul,

Assiming you are referring to VBA, try:

Dim NumOfRows As Long

NumOfRows = Selection.Rows.Count

---
Regards,
Norman


"Paul Ho" wrote in message
...

Hi,

Any function that could tell me how many rows have I selected?
i.e. I have selected cells(A1:E5), the function could show me 5 row.

Thanks





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default How many rows have I selected ?

You also have to force a recalc after selecting a range, the selection
itself won't do it.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jerry W. Lewis" wrote in message
...
There is no worksheet function for this. Take Norman's suggestion and
write it as a VBA User Defined Function

Function rowsSelected()
Application.Volatile
rowsSelected = Selection.Rows.Count
End Function

Declaring the the function to be volatile is necessary to get it to
recalculate in future recalculation events.

Jerry

Paul Ho wrote:

Hi, Norman,

Thanks for you help. But I need is function, not VBA. Is it any?

Regards
Paul

"Norman Jones" wrote:


Hi Paul,

Assiming you are referring to VBA, try:

Dim NumOfRows As Long

NumOfRows = Selection.Rows.Count

---
Regards,
Norman


"Paul Ho" wrote in message
...

Hi,

Any function that could tell me how many rows have I selected?
i.e. I have selected cells(A1:E5), the function could show me 5 row.

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
formula to use when number of rows changes dynamically confused Excel Worksheet Functions 3 August 17th 05 03:55 PM
REALLY miussing rows in Excel2000 Geoff Lambert Excel Discussion (Misc queries) 2 July 21st 05 03:20 PM
Create a report with selected rows based on the content in a cell ThirdTim New Users to Excel 1 May 5th 05 05:18 PM
flexible paste rows function that inserts the right number of rows marika1981 Excel Discussion (Misc queries) 1 February 18th 05 02:40 AM
Deselect one of many non-adjacent rows selected Nicolle K. Excel Discussion (Misc queries) 1 January 11th 05 06:24 PM


All times are GMT +1. The time now is 11:58 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"