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


Hi,

At present, I have a main file which imports data from 3 seperate excel
files. Each of which contains a number of rows of data. I would call up
one of these workbooks by the following;

Workbooks(StdfFile1).Activate

Now that this workbook is open, I would like to be able to "scan" how
many rows of data this sheet contains.

By knowing the number of rows in this file, I will be able to format my
main file better, and thereby reduce it's file size.

Anybody got ideas?

Jerry


--
PLPE
------------------------------------------------------------------------
PLPE's Profile: http://www.excelforum.com/member.php...o&userid=23856
View this thread: http://www.excelforum.com/showthread...hreadid=386392

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Scannig number of rows

Hi,

You can get the last non-blank row in Sheet1 by using the following (this
works up from last row in the sheet):

Dim lastrow as Long

With Worksheets("Sheet1")
lastrow=.Cells(rows.count,"A").end(xlup).row
End with

This assumes that column A is the "longest" so if this not the case, change
"A" to appropriate column.

HTH

"PLPE" wrote:


Hi,

At present, I have a main file which imports data from 3 seperate excel
files. Each of which contains a number of rows of data. I would call up
one of these workbooks by the following;

Workbooks(StdfFile1).Activate

Now that this workbook is open, I would like to be able to "scan" how
many rows of data this sheet contains.

By knowing the number of rows in this file, I will be able to format my
main file better, and thereby reduce it's file size.

Anybody got ideas?

Jerry


--
PLPE
------------------------------------------------------------------------
PLPE's Profile: http://www.excelforum.com/member.php...o&userid=23856
View this thread: http://www.excelforum.com/showthread...hreadid=386392


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
Fill Cells with same number in three rows then skip to next number Tracy Excel Worksheet Functions 2 November 7th 08 03:12 PM
Count number of rows, where non relevant rows are hidden Pieter Excel Discussion (Misc queries) 2 November 8th 06 12:24 PM
Get number of rows that data uses, including blank rows Denham Coote Excel Discussion (Misc queries) 5 August 22nd 06 02:10 PM
Get number of rows that data takes up, including blank rows Denham Coote Excel Worksheet Functions 2 August 21st 06 09:18 AM
flexible paste rows function that inserts the right number of rows marika1981 Excel Discussion (Misc queries) 1 February 18th 05 02:40 AM


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