insert row with the formula and borders before or after item based on inputbox user

MKLAQ

Active Member
Joined
Jan 30, 2021
Messages
428
Office Version
  1. 2016
Platform
  1. Windows
hello

I need macro to insert row based on using two inputboxes(before,after)

first should show "before inputbox " when write the item based on column A should insert row before the item with the same borders , formulas and if there is any cell is empty or contain formula ,then should show hyphen as in sheet RR when write CFR into inputbox user.

second if I press cancel or close "before inputbox" then should show "after inputbox" when write the item based on column A should insert row after the item with the same borders , formulas ,if there is any cell is empty or contain formula ,then should show hyphen as in sheet SR when write CMR into inputbox user

finally if I don't write any thing into "before inputbox " or "after inputbox" should insert multiple rows at once after last row for each item in column A as in sheet RP with considering the columns will increase every time then when insert row with formula,borders should finish until for any column contain values , if I run the macro again should replace data because the data it will increase every time into sheet MONTHLY

NOTE : all of the condition should implement in sheet MONTHLY.

EX (1).xlsm
ABCDEFGHIJKLM
1DETALESJANUARYFEBRUARYMARCH
2CODEGOODSTYPEPRPUSABLPUSABLPUSABL
3---------
4CRFCCR-1BMW20103802001801911835040310
5CCR-1BMW201112040802312230530275
6CCR-2TIGUAN20121200120100-10013510125
7CMRCCB-1AUDI2011801070234-234602040
8CCB-2OPEL20081001090123-12390-90
9CCB-3MER2009120101101231122110-110
10CCB-3MER2010101-101156-1561407070
RR
Cell Formulas
RangeFormula
M3:M10,J3:J10,G3:G10G3=E3-F3



EX (1).xlsm
ABCDEFGHIJKLM
1DETALESJANUARYFEBRUARYMARCH
2CODEGOODSTYPEPRPUSABLPUSABLPUSABL
3CRFCCR-1BMW20103802001801911835040310
4CCR-1BMW201112040802312230530275
5CCR-2TIGUAN20121200120100-10013510125
6AGGREGATE62024038014213013079080710
7CMRCCB-1AUDI2011801070234-234602040
8CCB-2OPEL20081001090123-12390-90
9CCB-3MER2009120101101231122110-110
10CCB-3MER2010101-101156-1561407070
11AGGREGATE3212030140263540134070270
RP
Cell Formulas
RangeFormula
J11:M11,E11:H11,J6:M6,E6:H6E6=SUM(E3:E5)
I6I6=SUM(J3:J5)
M7:M10,M3:M5,J7:J10,J3:J5,G7:G10,G3:G5G3=E3-F3
I11I11=SUM(J7:J10)




EX (1).xlsm
ABCDEFGHIJKLM
1DETALESJANUARYFEBRUARYMARCH
2CODEGOODSTYPEPRPUSABLPUSABLPUSABL
3CRFCCR-1BMW20103802001801911835040310
4CCR-1BMW201112040802312230530275
5CCR-2TIGUAN20121200120100-10013510125
6CMRCCB-1AUDI2011801070234-234602040
7----------
8CCB-2OPEL20081001090123-12390-90
9CCB-3MER2009120101101231122110-110
10CCB-3MER2010101-101156-1561407070
SR
Cell Formulas
RangeFormula
M3:M10,J3:J10,G3:G10G3=E3-F3

EX (1).xlsm
ABCDEFGHIJKLM
1DETALESJANUARYFEBRUARYMARCH
2CODEGOODSTYPEPRPUSABLPUSABLPUSABL
3CRFCCR-1BMW20103802001801911835040310
4CCR-1BMW201112040802312230530275
5CCR-2TIGUAN20121200120100-10013510125
6CMRCCB-1AUDI2011801070234-234602040
7CCB-2OPEL20081001090123-12390-90
8CCB-3MER2009120101101231122110-110
9CCB-3MER2010101-101156-1561407070
MONTHLY
Cell Formulas
RangeFormula
M3:M9,J3:J9,G3:G9G3=E3-F3
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
when write the item into inputbox based on column B not A .
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,117
Members
453,021
Latest member
Justyna P

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