PDA

View Full Version : Inser a row based on the cell value in a column



Tharabai
09-27-2015, 08:33 AM
Hello Everyone,

I need to insert a row based on the cell value in column Q. If the cell value is KAA or MAA then a row to be inserted and fill the values.

I have a sheet with the column A to Q. For the inserted rows the values should be same as prior row for the columns A,B,C,D,G,L and for others the value to be filled from the data in the another sheet.

For the column E, the value should be Aux if the prior value is "cont". And Colum F should be filled from the data from sheet2 based on the value from Q, E. If the cell value in column Q is "KAA" and Column E is "Aux" then the value for that should be picked from Sheet2.

SamT
09-27-2015, 10:37 AM
Please provice a workbook with three sheets.
Sheet 1 should have two rows with data, one with "KAA" and one with "MAA."
Sheet 2 should have at least one row of data
Sheet three, (Results," should look like you want sheet1 should look after the macro runs (4 rows) ecxcept, Fill the tqwo "Inserted" Rows with formulas that provide the data from the rows above and from sheet 2 that should be in them.

Examples:
Row 1 has "KAA":
Range (A2) Formula = "=A1"
Range (E2) formula = "=IF(E1="Cont","Aux",?)
Range (F2) Formula = IF(AND(Q1="KAA),E2="Aux"),Sheet2!A1,?)

Row 3 has "WAA":
Repeat for Row 4

Tharabai
09-28-2015, 09:27 AM
Hi, I have attached the sample workbook for your reference.

Sheet named "original" will be sheet I use, as I said in my initial post I will perform the steps.

Sheet named "result" will be expected result. Yellow lines are the inserted lines and the values are filled from sheet2 based on the values from column G, column F and column A.

if KAA , 201, contract for that particular value from sheet2 to be picked for the columns B,C,D,E.

Tharabai
09-30-2015, 10:18 AM
Any help pls..