Create sophisticated loop
Dear guys,
im currently struggling with creating a vba code for the problem displayed:
Please create a temp_sheet, transfer the values and formatting from the first sheet found with the prefix "raw_" and apply a text filter in the temp_sheet.
Find the selected range in sheet "table 1" in column A and use the neighboring values in column B as filter criteria in the text filter in column B of the temp_sheet.
table 1 looks like this (user selects all File A cells)
Column A |
Column B |
|
|
|
File A |
454/456zzuuCd/452 |
|
|
|
File A |
100-100 |
|
|
|
File A |
Advc9873 |
|
|
|
File B |
4545 |
|
|
|
then the temp_sheet should look like this
Column A |
Column B |
Column C |
24-06-24 |
24-06-25 |
24-06-26 |
24-06-27 |
SheetB |
454/456zzuuCd/452 |
Travel |
0,5 |
|
|
|
SheetB |
100-100 |
Training |
|
-1,7 |
|
|
SheetB |
Advc9873 |
Travel |
|
|
|
8 |
|
|
|
|
|
|
|
In the next step, i want the content of the cells (starting from column B and row 2) to be inserted to the sheet, whose name is in column A. When inserting it to the respective sheet, i want the correspondending column header to be considered, because the arrangement of columns of temp_sheet and e.g. SheetB deviates from another.
keep in mind, that
1) table 1: the selected range in table 1 can consider out of more then >50 cells
2) table 1: the structure of neighboring values in column B can deviate in terms of string (number/values/letters)
3) temp_sheet/SheetB: the amount of columns can be more >100 columns, but i want everything to be considerd, if the criteria matches
4) in some cases, temp_sheet can have columns headers, that dont exist in SheetB. Those columns should be skipped.
5) once the values have been successfully transmitted into SheetB, i want temp_sheet to be cleared and the content of "raw_" sheet no.2 to be inserted and to repeat everything like with the first "raw_" sheet. I want to process all "raw_" sheets, one by one.
Can someone help me?
Thank you very much!!