Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How to get number of all rows in every datasheet together?

I have to count all rows in every datasheet and than get the sum of all rows
of the Excel file, that contain data.

It is a large Excel file with about 80 datasheets so do it manuall is not
possible.

Thank you
--
Regards
Jan Kratochvil
WIN XP Pro SP2, Office 2007 SP 1
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to get number of all rows in every datasheet together?

You could use a macro that loops through all the worksheets in that workbook.
This basis the count on the number of used rows in column A:

Option Explicit
Sub testme()
dim TotalRows as long
dim wks as worksheet

totalrows = 0
for each wks in activeworkbook.worksheets
totalrows = totalrows + application.counta(wks.range("A:A"))
next wks

msgbox totalrows
End sub

You could replace that msgbox with something like:

worksheets("Somesheetnamehere").range("x99").value = totalrows

Change the name of the worksheet and the address of the cell to what you want.

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Jan Kratochvil wrote:

I have to count all rows in every datasheet and than get the sum of all rows
of the Excel file, that contain data.

It is a large Excel file with about 80 datasheets so do it manuall is not
possible.

Thank you
--
Regards
Jan Kratochvil
WIN XP Pro SP2, Office 2007 SP 1


--

Dave Peterson
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
datasheet with data that is not graphed help_me_pls Charts and Charting in Excel 1 July 30th 07 06:54 PM
How to automate datasheet stuffing? Karl Excel Worksheet Functions 1 July 17th 07 12:02 AM
Population org char from a datasheet smaruzzi Excel Discussion (Misc queries) 0 July 10th 07 08:38 PM
Text box linked to datasheet bacs Charts and Charting in Excel 0 September 13th 05 06:38 PM
Where is the viewing datasheet button? Sam Charts and Charting in Excel 2 January 4th 05 09:25 AM


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