Need VBA code for Copy+insert / Delete rows & columns by criteria

lico13

New Member
Joined
Dec 14, 2016
Messages
3
Hi,

Can you please help? I need it urgently.

I need a VBA code solution for copy+insert / delete rows & columns by criteria (attached an example Excel file):

When type "1" in column A next to a certain row and press the macro button, row 8 (the example row) will be copied entirely and
INSERTED above the selected row.
When type "0" in column A next to the selected row and press the macro button, the selected row will be entirely deleted.

If it's OK, I would like to add another request:
When pressing the 2nd macro button, 3 columns with previous month dates will be deleted entirely (at the left)
and at the same time 3 columns with new month dates will be added with all formulas in them (at the right).

*** Note that I need these 2 macros for multiple sheets with identical table structure so I think it will be best to write the codes just once and put macro buttons to the same macros.

Thanks in advance
001.gif


VBA Express Forum
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi,

Still didn't get any response to my thread...

I already found a solution to my first question so I need a solution for the second one only:

Can you please help? I need it urgently.


I need a VBA code solution for add / delete columns by criteria (attached an example Excel file):

When pressing the macro button, 3 columns with previous month dates will be deleted entirely (at the left)
and at the same time 3 columns with new month dates will be added with all formulas in them (at the right).

*** Note that I need these 2 macros for multiple sheets with identical table structure so I think it will be best to write the codes just once and put macro buttons to the same macros.

Thanks in advance
001.gif


Here is a link to my post in other forum with the example file that I can't attach here...
VBA Express Forum
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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