Michael1984DK
New Member
- Joined
- Apr 30, 2018
- Messages
- 27
Hi.
I have a need to make a script, that opens and looks through all files within a selected folder. In each file, it should look for a certain IF sentence. If the cell in the line of the specific file = TRUE, it should copy these lines to a new file. The idea is to add and collect all the "valid" lines into one file in continued order (so copy to first empty line or where cell x = "").
I already have a VBA script, that opens each file with a user selected folder, but I am not sure how to do the last part for each file (the action itself).
I think it would be easiest to have a "summary file" containing the "open all files and do action" script within. This should also be the file to copy the valid lines from the other files into.
Ex:
File 1:
No
No
No
Yes - Copy to summary in first empty line
Yes - Copy to summary in first empty line
No
Yes - Copy to summary in first empty line
File 2:
Yes - Copy to summary in first empty line
Yes - Copy to summary in first empty line
No
No
Yes - Copy to summary in first empty line
No
Summary..
Yes (from file 1 line 4)
Yes (from file 1 line 5)
Yes (from file 1 line 7)
Yes (from file 2 line 1)
Yes (from file 2 line 2)
Yes (from file 2 line 4)
Does this make sense and can it be done somehow?
Thank you.
I have a need to make a script, that opens and looks through all files within a selected folder. In each file, it should look for a certain IF sentence. If the cell in the line of the specific file = TRUE, it should copy these lines to a new file. The idea is to add and collect all the "valid" lines into one file in continued order (so copy to first empty line or where cell x = "").
I already have a VBA script, that opens each file with a user selected folder, but I am not sure how to do the last part for each file (the action itself).
I think it would be easiest to have a "summary file" containing the "open all files and do action" script within. This should also be the file to copy the valid lines from the other files into.
Ex:
File 1:
No
No
No
Yes - Copy to summary in first empty line
Yes - Copy to summary in first empty line
No
Yes - Copy to summary in first empty line
File 2:
Yes - Copy to summary in first empty line
Yes - Copy to summary in first empty line
No
No
Yes - Copy to summary in first empty line
No
Summary..
Yes (from file 1 line 4)
Yes (from file 1 line 5)
Yes (from file 1 line 7)
Yes (from file 2 line 1)
Yes (from file 2 line 2)
Yes (from file 2 line 4)
Does this make sense and can it be done somehow?
Thank you.