My question is SIMILAR but not exactly the same as another post found on this forum VBA REQUEST: Paste Values of Multiple Sheets Based on the *Header Name* in Destination Sheet
In my workbook the user has an Index Tab where they define policy in columns F:Z
So in F 1 might be Hourly Full Time; G1 Hourly Reduced Time; H1 Salary Full Time - these headers are not static and can be whatever the user needs them to be
Columns A and B are hidden for tracking purposes and versions etc.
Beginning in Column C Row 3 are individual Chapters i.e. C3 = Punch & Schedule Rules; C4=Holiday Rules; C5=Overtime Rules
Where these intersect with F, G, H etc. there is a set of drop down selections (the same for each chapter) so under F1 row 3 would have a set of drop downs of which one is Input Punch & Schedule Rules; F1 row 4 would have the same set of drop downs except the Input option will be Input Holiday Rules; F1 row 4 would have the same set of drop downs except Input option would be Input Overtime Rules.
The user can start anywhere they want from this Index page i.e. they want to start with Salary Full Time and Input Holiday Rules so they select this drop down. The code copies the header from wherever user selected, in this case it finds that C4 is under column H and copies the column H header to a new sheet which is called the Holiday Rules chapter. It copies this header into Column F, presents a punch of questions to the user and when they are done and click save it moves the entire policy over to column G on the Holiday Chapter. All chapters have this 'code' in column F to collect the policy and move the completed policy defined over to the first blank column to the right.
Some headers on the Index won't have chapter input i.e. Salary wouldn't have an overtime chapter filled out so the Overtime chapter headers may only be 2 policy names but Punch & Schedules would have 3 header policy names etc.
Subsequently on a Chapter sheet a user can use an 'edit' button, point to the column that has the policy they need to edit. The code moves it back to F for updates, removes the blank column from which it came, allows the user to save and it pushes to the next blank column in the individual chapter
So, if there are 10 policy names on the Index page and the user has moved about as they want, within each chapter 'headers' won't be in the same place i.e. User could have chosen to fill in Salary for Holliday Rules so Holiday Rules column G will be Salary FT, but then they decided to work on Full Time for Punch & Schedules hence the Punch & Schedules sheet has Salary FT header in column G, and so on.
I now need a 'review' page where every policy from each chapter is pushed to one sheet for review copying each header from each sheet and the subsequent questions and responses from each sheet. For example sheet Punch & Schedules has 120 questions. The code needs to pull all the headers (of which I won't know what they are or what order they are in) and all the questions which reside in column C and the responses to each in columns G:Z. Needs to push this set to a review page. Then circle back to the next chapter, the Holiday Rules which has a total of 44 questions/answers. Match the headers from the new review sheet, cycle to the Holiday sheet, find the header and only bring over the Q and response for each and put it under the matching header below the 120 from Punch & Schedules. Then circle back and do the same for the Overtime sheet etc through all 10 chapters.
Can anyone assist as I've read the thread mentioned at the beginning of this but because I don't have static name, date headers etc. I am at a loss as to how to proceed with finding the matching unknown headers as well as ensuring that all headers and info are picked up since not every chapter (sheet) will have the same set of unknown headers. Any assistance would be much appreciated.
In my workbook the user has an Index Tab where they define policy in columns F:Z
So in F 1 might be Hourly Full Time; G1 Hourly Reduced Time; H1 Salary Full Time - these headers are not static and can be whatever the user needs them to be
Columns A and B are hidden for tracking purposes and versions etc.
Beginning in Column C Row 3 are individual Chapters i.e. C3 = Punch & Schedule Rules; C4=Holiday Rules; C5=Overtime Rules
Where these intersect with F, G, H etc. there is a set of drop down selections (the same for each chapter) so under F1 row 3 would have a set of drop downs of which one is Input Punch & Schedule Rules; F1 row 4 would have the same set of drop downs except the Input option will be Input Holiday Rules; F1 row 4 would have the same set of drop downs except Input option would be Input Overtime Rules.
The user can start anywhere they want from this Index page i.e. they want to start with Salary Full Time and Input Holiday Rules so they select this drop down. The code copies the header from wherever user selected, in this case it finds that C4 is under column H and copies the column H header to a new sheet which is called the Holiday Rules chapter. It copies this header into Column F, presents a punch of questions to the user and when they are done and click save it moves the entire policy over to column G on the Holiday Chapter. All chapters have this 'code' in column F to collect the policy and move the completed policy defined over to the first blank column to the right.
Some headers on the Index won't have chapter input i.e. Salary wouldn't have an overtime chapter filled out so the Overtime chapter headers may only be 2 policy names but Punch & Schedules would have 3 header policy names etc.
Subsequently on a Chapter sheet a user can use an 'edit' button, point to the column that has the policy they need to edit. The code moves it back to F for updates, removes the blank column from which it came, allows the user to save and it pushes to the next blank column in the individual chapter
So, if there are 10 policy names on the Index page and the user has moved about as they want, within each chapter 'headers' won't be in the same place i.e. User could have chosen to fill in Salary for Holliday Rules so Holiday Rules column G will be Salary FT, but then they decided to work on Full Time for Punch & Schedules hence the Punch & Schedules sheet has Salary FT header in column G, and so on.
I now need a 'review' page where every policy from each chapter is pushed to one sheet for review copying each header from each sheet and the subsequent questions and responses from each sheet. For example sheet Punch & Schedules has 120 questions. The code needs to pull all the headers (of which I won't know what they are or what order they are in) and all the questions which reside in column C and the responses to each in columns G:Z. Needs to push this set to a review page. Then circle back to the next chapter, the Holiday Rules which has a total of 44 questions/answers. Match the headers from the new review sheet, cycle to the Holiday sheet, find the header and only bring over the Q and response for each and put it under the matching header below the 120 from Punch & Schedules. Then circle back and do the same for the Overtime sheet etc through all 10 chapters.
Can anyone assist as I've read the thread mentioned at the beginning of this but because I don't have static name, date headers etc. I am at a loss as to how to proceed with finding the matching unknown headers as well as ensuring that all headers and info are picked up since not every chapter (sheet) will have the same set of unknown headers. Any assistance would be much appreciated.