When a value is detected in a cell, a VBA code or function will insert a new row with specific values and functions already in each cell

ubergreen

New Member
Joined
Jun 13, 2024
Messages
33
Office Version
  1. 2021
Been trying to wrap my head around this one.

I need my Sheet1 to be able to create a new row whenever it encounters a cell that has a value in it other than 0 on Sheet2, which in this case would be A4, A10
and A13. I would like for this to be done automatically for all rows in Sheet1.

I am not sure if it will make much of a difference, but Sheet2 will actually be a different workbook, which I can simply call Workbook2. I just put the example as sheets to make it visually easier to view.

Sheet1 below. I wrote the formulas/functions that I am using for this sheet to fill in the current values
sheet1 original.jpg



Sheet2 below, which is being used as the reference sheet for Sheet1
sheet2.jpg





This is how I want the new Sheet1 to look like after.
- A new row is inserted above Order 1007,1004, 1001.
- The value from the cell below the new row is used to fill the new cell in column A
- The formula/value "TRUE" will always be applied for every cell in column B
- The quantity for the cell in the new inserted row will always be a 0 in column C
- The Taxes from Sheet2 will be added in the new row under Price in column D
- The State information will be duplicated for every cell in column E for that particular Order

sheet1 new.jpg
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,223,702
Messages
6,173,959
Members
452,539
Latest member
delvey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top