Hi, no it has to be "test" in this case.
Code:
If Right(folderPath, 1) <> "\" Then folderPath = folderPath + "\"
filename = Dir(folderPath & "*.xlsx")
Do While filename <> ""
Application.ScreenUpdating = False
Set wb = Workbooks.Open(folderPath & filename)
iVal = Application.WorksheetFunction.CountIf(Range("A1:A100"), "test")
'Call a subroutine here to operate on the just-opened workbook
'Call Mymacro
Windows("other workbook.xlsm").Activate
Range("h1").Value = iVal
filename = Dir
Loop
Application.ScreenUpdating = True
End Sub
this is what I'm working on at the moment. but iVal is returning a 0 value. I'm trying to figure out why.
the information I want will always be listed first (under the headers) and then at the bottom is some information that I don't need and if copied over will interfere with my other code.
BUT, that other useless info is always on three rows... so perhaps.
Code:
lastRow = Cells(Rows.Count,"A").End(xlUp).Row
iVal = lastRow -3
Ill see what happens.