keith05281967
Board Regular
- Joined
- May 6, 2011
- Messages
- 68
Greetings,
Okay, i'm a bit more prepared to ask my question this time.
I'd like to be able to go thru all the workbooks in a folder, check the row count and record that information either in a msgbox or spdsheet. I have some code that does some of this. I probably need to add an array to record all the counts
Sub RowCount()
Dim path As Variant
Dim excelfile As Variant
Dim NumRows As Integer
path = "C:\Documents and Settings\My Documents\Macro Testing\test directory code\"
excelfile = Dir("*.xls")
Do While excelfile <> ""
Workbooks.Open Filename:=path & excelfile
excelfile = Dir
NumRows = Application.WorksheetFunction.CountA(Range("A1:A65536"))
ActiveWorkbook.Close
Loop
End Sub
I'd want the results to look like this:
fileA........................50
fileB........................35
filec........................112
thanks,
Keith
Okay, i'm a bit more prepared to ask my question this time.
I'd like to be able to go thru all the workbooks in a folder, check the row count and record that information either in a msgbox or spdsheet. I have some code that does some of this. I probably need to add an array to record all the counts
Sub RowCount()
Dim path As Variant
Dim excelfile As Variant
Dim NumRows As Integer
path = "C:\Documents and Settings\My Documents\Macro Testing\test directory code\"
excelfile = Dir("*.xls")
Do While excelfile <> ""
Workbooks.Open Filename:=path & excelfile
excelfile = Dir
NumRows = Application.WorksheetFunction.CountA(Range("A1:A65536"))
ActiveWorkbook.Close
Loop
End Sub
I'd want the results to look like this:
fileA........................50
fileB........................35
filec........................112
thanks,
Keith