insert column and autofill based on cell value

Ali M

Active Member
Joined
Oct 10, 2021
Messages
330
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Hello I would insert column after column B and auto fill name until lastrow with ignore TOTAL row based on H1
DD.xlsm
ABCDEFGH
1DATEDETAILSSAFESDEBITCREDITBALANCEALI
220/03/2024SALES INVOICEBANK310003100
320/03/2024SALES INVOICESHOP SAFE480007900
420/03/2024SALES INVOICEHOME SAFE4200012100
520/03/2024RECEIVED CASHBANK3000015100
620/03/2024PAID CASHSHOP SAFE0440010700
720/03/2024PAID CASHHOME SAFE027008000
821/03/2024SALES INVOICESHOP SAFE100001000
921/03/2024SALES INVOICEHOME SAFE120002200
1021/03/2024PAID CASHSHOP SAFE022000
1121/03/2024RECEIVED CASHHOME SAFE1000011008900
1222/03/2024RECEIVED CASHBANK300003000
1323/03/2024RECEIVED CASHHOME SAFE200002000
1423/03/2024RECEIVED CASHBANK500007000
1523/03/2024PAID CASHSHOP SAFE3000010000
16TOTAL0029900
A
Cell Formulas
RangeFormula
D16:E16D16=SUM(L2:L15)



RESULT
DD.xlsm
ABCDEFGHI
1DATEDETAILSNAMESAFESDEBITCREDITBALANCEALI
220/03/2024SALES INVOICEALIBANK310003100
320/03/2024SALES INVOICEALISHOP SAFE480007900
420/03/2024SALES INVOICEALIHOME SAFE4200012100
520/03/2024RECEIVED CASHALIBANK3000015100
620/03/2024PAID CASHALISHOP SAFE0440010700
720/03/2024PAID CASHALIHOME SAFE027008000
821/03/2024SALES INVOICEALISHOP SAFE100001000
921/03/2024SALES INVOICEALIHOME SAFE120002200
1021/03/2024PAID CASHALISHOP SAFE022000
1121/03/2024RECEIVED CASHALIHOME SAFE1000011008900
1222/03/2024RECEIVED CASHALIBANK300003000
1323/03/2024RECEIVED CASHALIHOME SAFE200002000
1423/03/2024RECEIVED CASHALIBANK500007000
1523/03/2024PAID CASHALISHOP SAFE3000010000
16TOTAL0029900
A
Cell Formulas
RangeFormula
E16:F16E16=SUM(M2:M15)

when run the macro I don't repeat insert column every time
thanks
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
after insert column will change formulas in location .
can you add formulas in TOTAL lastrow by sum column E,F and in column G=E-F
thanks again.
 
Upvote 0
after insert column will change formulas in location
If the formulas already exist in the TOTAL last row, when a new column is inserted, the formulas should adjust automatically.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,179
Members
452,615
Latest member
bogeys2birdies

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