View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Steve[_117_] Steve[_117_] is offline
external usenet poster
 
Posts: 3
Default Copy part of text file

OK So I'm sure now that it is the If LCase(Right(FilesInPath, 10))
Like "File*.txt" Then bit that is getting me but Im not sure how to
fix it...

Here is the deal... I need to open a specific set of daily files in
the target folder. The file name is constructed as such,
abcYYYYMMDD.txt. The year and month are input earlier in the routine
and is working for that particular section of the routine. They are
both input as strings sYear and sMonth. I need to open each file for
the input year and month, insert a blank row at the top and insert the
formula =SUMPRODUCT(--($b$2:$b$500="TEST"),(f$2:f$500)) in F1:AE1.
Then copy F1:AE1 to my base book starting in AC3:AZ3, the next file
will paste into AC4:AZ4 and so on.

So how do I modify If LCase(Right(FilesInPath, 10)) Like "File*.txt"
I'm guessing that I should change it to Left and use abc and sYear and
sMonth some how but not sure exacly how.
Thanks!