Hello, I need some help on VBA, please. I've inlcuded an short example below of what I am trying to achieve.
I am trying to figure out the VBA to insert a variable number of rows (based on the value in Settings!C13) between existing rows on the worksheet 'UNIT_PRICE_COMP'. Some rows are category headers, and this is reflected by the value in column B being less than 1000.
Essentially, I need VBA for the following: For each cell in B < 1000, Insert X number of rows, where X = Settings!C13.
Finally, in column G, I need to add the name of the Partner, from the settings page. I need to include the value from Settings!C7 on the first row of any added rows, Settings!C9 on the next, and Settings!C11 on row 3 (if there is a third inserted row).
In the example below, the 'Settings' tab values are as follows:
Settings!C7 = PARTNER 1
Settings!C9 = PARTNER 2
Settings!C11 = PARTNER 3
Settings!C13 = 2
Any help is greatly appreciated!
I am trying to figure out the VBA to insert a variable number of rows (based on the value in Settings!C13) between existing rows on the worksheet 'UNIT_PRICE_COMP'. Some rows are category headers, and this is reflected by the value in column B being less than 1000.
Essentially, I need VBA for the following: For each cell in B < 1000, Insert X number of rows, where X = Settings!C13.
Finally, in column G, I need to add the name of the Partner, from the settings page. I need to include the value from Settings!C7 on the first row of any added rows, Settings!C9 on the next, and Settings!C11 on row 3 (if there is a third inserted row).
In the example below, the 'Settings' tab values are as follows:
Settings!C7 = PARTNER 1
Settings!C9 = PARTNER 2
Settings!C11 = PARTNER 3
Settings!C13 = 2
Any help is greatly appreciated!
Column B | Column C | Column D | Column E | Column F | Column G | |
Row 3 | ITEM NO. | CHAPTER | ITEM DESCRIPTION | UNIT | TYPE | PARTNER |
Row 4 | ||||||
Row 5 | 10 | 1.01 - ROADW | ROADWAY REMOVALS | D | ||
Row 6 | 1000 | 1.01 - ROADW | PREPARING ROW | AC | D | |
inserted by VBA | PARTNER 1 | |||||
inserted by VBA | PARTNER 2 | |||||
Row 7 | 1010 | 1.01 - ROADW | REMOVING CONC (PAV) | SY | D | |
inserted by VBA | PARTNER 1 | |||||
inserted by VBA | PARTNER 2 | |||||
Row 8 | 1020 | 1.01 - ROADW | REMOVING CONC (RIPRAP) | SY | D | |
inserted by VBA | PARTNER 1 | |||||
inserted by VBA | PARTNER 2 |