Hi All,
I am trying to write a VBA code to perform the task mentioned in the title. Here are the specifics:
Notes:
-The function needs to loop from row 1 to the last row that contains a value (in Sheet1). The range can be a static range for Sheet2.
-Row A will always be used for the check between Sheet1 and Sheet2 to see if a matching value exists
Goal:
-Loop from row A1 to the last row that contains a value in sheet 1 to see if these values exist in Sheet 2.
-For all values that do exist in Sheet2, I need to find the associated sub parts under that value and copy the range of rows for those parts
-The amount of sub parts will change for every instance but they will always start in column B at matching row +1 and they will end with the next blank in column B
-As an example, if a matching part is found in A4 on Sheet2, and the associated sub parts are in cells B5 through B9, I need to copy rows 5-9 (with B10 being the blank value the code found)
-Insert the copied rows from Sheet2 into Sheet1 one row below the value that matched.
-For example, if cell A1 on Sheet1 contains the value that matched cell A4 on Sheet2, insert rows B5 through B9 from Sheet2 one row below A1 on Sheet1.
I apologize if this is unclear, it is hard to convey the information properly without attaching a sample workbook.
Thank you for the help.
I am trying to write a VBA code to perform the task mentioned in the title. Here are the specifics:
Notes:
-The function needs to loop from row 1 to the last row that contains a value (in Sheet1). The range can be a static range for Sheet2.
-Row A will always be used for the check between Sheet1 and Sheet2 to see if a matching value exists
Goal:
-Loop from row A1 to the last row that contains a value in sheet 1 to see if these values exist in Sheet 2.
-For all values that do exist in Sheet2, I need to find the associated sub parts under that value and copy the range of rows for those parts
-The amount of sub parts will change for every instance but they will always start in column B at matching row +1 and they will end with the next blank in column B
-As an example, if a matching part is found in A4 on Sheet2, and the associated sub parts are in cells B5 through B9, I need to copy rows 5-9 (with B10 being the blank value the code found)
-Insert the copied rows from Sheet2 into Sheet1 one row below the value that matched.
-For example, if cell A1 on Sheet1 contains the value that matched cell A4 on Sheet2, insert rows B5 through B9 from Sheet2 one row below A1 on Sheet1.
I apologize if this is unclear, it is hard to convey the information properly without attaching a sample workbook.
Thank you for the help.