I need a macro to extract specific text from multiple excel files into one single file.
The logic is below:
loop through all excel files in a directory
in each file, search for a specific section (This section is identified by: begin with column "A" containing the word "SPECIAL" and end with an empty row) Note: in one file, there could be multiple "SPECIAL" sections.
Within this section, I want to search for a particular row that meet this criteria:
display only row that contains bold text in column "B" and value of less than 7 in column "D".
If found something, then write the result into the new excel file: containing the file name and section name (that is the word that has "SPECIAL" in column A)
end of loop
Therefore, the output of the result could be like this:
filename1: SPECIAL SECTION A
y BOOK yyy 6
z CASE zzz 5
filename2: SPECIAL SECTION C
k TOY kkk 3
filename3: SPECIAL SECTION D
etc ....
BOOK,CASE and TOY should be in bold.
I also need a slight modification of the script, to write the output only if it find only one row that meet the criteria. In above case, it will only write filename2: SPECIAL SECTION C as it only has one row.
Any help or hint will be much appreciated
Bookmarks