Ago
04-26-2010, 07:45 PM
Im making a summary workbook which gets data from other workbooks in the same directory.
The macro is supposed to run each time i run the file.
But now the problem, i dont want multiple rows of the same data.
So im trying to create a if-statement like this
If stFile <> Application.Workbooks(1).Name Or WorksheetFunction.CountIf(Range("A"), Left(stFile, InStr(stFile, ".") - 1)) Then
stFile is the name of the current file ist about to get data from.
The first part of the if makes sure its not trying to pull data from itself.
After that im trying to figure out if the filename is already listed somewhere in column A.
I have tried vlookup, match and now countif to work but i cant get any of them working the way i want.
I just need a way to figure out if the filename is in column A without it returning a error code if its false, which both vlookup and match does.
Please help.
And why do i keep geting this errormessage from excel every 5 minutes, Its really ****ing me off!
How do i disable it, i know it contains macros.
The macro is supposed to run each time i run the file.
But now the problem, i dont want multiple rows of the same data.
So im trying to create a if-statement like this
If stFile <> Application.Workbooks(1).Name Or WorksheetFunction.CountIf(Range("A"), Left(stFile, InStr(stFile, ".") - 1)) Then
stFile is the name of the current file ist about to get data from.
The first part of the if makes sure its not trying to pull data from itself.
After that im trying to figure out if the filename is already listed somewhere in column A.
I have tried vlookup, match and now countif to work but i cant get any of them working the way i want.
I just need a way to figure out if the filename is in column A without it returning a error code if its false, which both vlookup and match does.
Please help.
And why do i keep geting this errormessage from excel every 5 minutes, Its really ****ing me off!
How do i disable it, i know it contains macros.