nirvehex
10-07-2015, 01:28 PM
Hi,
I'm trying to create a VBA code to do the following:
I have one tab called "Recommendations" and the two variables that inserting a blank row depends on are found in columns CH and CV.
Essentially on the tab called "Recommendations", I would like to look at each row starting with row 3 to the last row with data in it (control + down).
I'm trying to have the code look at the two columns, CH and CV and if it finds that CH = "Yes" and CV = "Third Party" then look at column E on "Recommendations" to identify it's code (6 digit number). Then the code should go over to another tab called "Raw" and find that same 6 digit number in column M. In this column M on the "raw" sheet the code may be repeated twice, three, or even several times, but they are always grouped together.
For example you might see something like this in column M on the "Raw" tab:
1234581
1234581
1234581
1305969
1306000
1474942
1474942
1234604
1234604
1234604
1234604
What I'm trying to get the code to do is go down to the last like 6 digit code and insert a blank row underneath it if and only if it's respective CH and CV columns on the "Recommendations" tab = "Yes" & "Third Party".
So to recap (and I hope I'm making some kind of sense here):
On recommendations tab row 3 to end, if and only if CH= "Yes" and CV = "Third Party", find code in column E on recommendations and match it to same code in column M on "Raw" tab. Then go down to last row with same code and insert blank row underneath it.
1) Identify IDs on recommendation tab in column E where column CH = "Yes" & CV = "Third Party".
2) Find identified IDS on raw tab in column M
3) Go down to last like ID in grouping and insert blank row below.
4) Repeat for all IDS that met that qualification.
Any ideas? I am so lost...
Thanks!
Note: Cross posted @ http://www.mrexcel.com/forum/excel-questions/892554-visual-basic-applications-insert-blank-row-based-two-variables.html
I'm trying to create a VBA code to do the following:
I have one tab called "Recommendations" and the two variables that inserting a blank row depends on are found in columns CH and CV.
Essentially on the tab called "Recommendations", I would like to look at each row starting with row 3 to the last row with data in it (control + down).
I'm trying to have the code look at the two columns, CH and CV and if it finds that CH = "Yes" and CV = "Third Party" then look at column E on "Recommendations" to identify it's code (6 digit number). Then the code should go over to another tab called "Raw" and find that same 6 digit number in column M. In this column M on the "raw" sheet the code may be repeated twice, three, or even several times, but they are always grouped together.
For example you might see something like this in column M on the "Raw" tab:
1234581
1234581
1234581
1305969
1306000
1474942
1474942
1234604
1234604
1234604
1234604
What I'm trying to get the code to do is go down to the last like 6 digit code and insert a blank row underneath it if and only if it's respective CH and CV columns on the "Recommendations" tab = "Yes" & "Third Party".
So to recap (and I hope I'm making some kind of sense here):
On recommendations tab row 3 to end, if and only if CH= "Yes" and CV = "Third Party", find code in column E on recommendations and match it to same code in column M on "Raw" tab. Then go down to last row with same code and insert blank row underneath it.
1) Identify IDs on recommendation tab in column E where column CH = "Yes" & CV = "Third Party".
2) Find identified IDS on raw tab in column M
3) Go down to last like ID in grouping and insert blank row below.
4) Repeat for all IDS that met that qualification.
Any ideas? I am so lost...
Thanks!
Note: Cross posted @ http://www.mrexcel.com/forum/excel-questions/892554-visual-basic-applications-insert-blank-row-based-two-variables.html