Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Number of rows not empty

A beginner question:
how, in VBA, do I get the number of rows that are not MT in a sheet ? In
other words, how do I make VBA count the number of records in a sheet,
assuming that the first MT row is the end of the file

Thank you

Jacquelin Hardy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Number of rows not empty

NumRows = Application.Counta(Columns(1)))


"gps 4 pilots" wrote in message
...
A beginner question:
how, in VBA, do I get the number of rows that are not MT in a sheet ? In
other words, how do I make VBA count the number of records in a sheet,
assuming that the first MT row is the end of the file

Thank you

Jacquelin Hardy




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Number of rows not empty

set rng = cells(rows.count,1).End(xlup)
msgbox "number of non empty rows is " & rng.row

Number of records would be one less than that if the first row is a header
row.

--
Regards,
Tom Ogilvy

"gps 4 pilots" wrote in message
...
A beginner question:
how, in VBA, do I get the number of rows that are not MT in a sheet ? In
other words, how do I make VBA count the number of records in a sheet,
assuming that the first MT row is the end of the file

Thank you

Jacquelin Hardy




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Number of rows not empty

Thank's Tom
Thank's Bob

JH

"Tom Ogilvy" wrote in message
...
set rng = cells(rows.count,1).End(xlup)
msgbox "number of non empty rows is " & rng.row

Number of records would be one less than that if the first row is a header
row.

--
Regards,
Tom Ogilvy

"gps 4 pilots" wrote in message
...
A beginner question:
how, in VBA, do I get the number of rows that are not MT in a sheet ? In
other words, how do I make VBA count the number of records in a sheet,
assuming that the first MT row is the end of the file

Thank you

Jacquelin Hardy






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
How Do U number a list of names, but there are empty rows in betw Paula Excel Discussion (Misc queries) 5 January 9th 08 04:25 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
How do I sort with empty rows between none empty rows? Excel Challenged Excel Worksheet Functions 1 August 17th 06 03:59 PM
Pivot Tables: How do I show ALL field rows, including empty rows?? [email protected] Excel Worksheet Functions 2 April 8th 05 06:21 PM
Can Excel "slide up" rows with content thru empty rows to condense portly44 Excel Worksheet Functions 2 April 1st 05 12:47 AM


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