Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fill Cells with same number in three rows then skip to next number | Excel Worksheet Functions | |||
Count number of rows, where non relevant rows are hidden | Excel Discussion (Misc queries) | |||
Get number of rows that data uses, including blank rows | Excel Discussion (Misc queries) | |||
Get number of rows that data takes up, including blank rows | Excel Worksheet Functions | |||
flexible paste rows function that inserts the right number of rows | Excel Discussion (Misc queries) |