VBA Code Help Add/Delete Columns Based on Criteria in Different Worksheet

Mayred

New Member
Joined
Oct 27, 2017
Messages
1
Hello,

I am still learning VBA but I have been asked to create a macro for a timesheet for my boss. It is a timesheet where each employee has time recorded weekly and separated by projects. The weekly start date is in Row 1 as a merged cell and the employee's names are in Row 2 followed by all the time below them. It starts at Column S.

In a separate worksheet I have created a small table with Add, Delete, and Date with a hierarchy table below to denote the order they should be in. Also there is a sample row for copying reasons.

What I need to do is create two macros, one to add and one to delete. The one to delete will take the name in Sheet2 and find the name in Row 2 in Sheet1 and delete the columns if they are greater than the date. The second one needs to take the copied cell and, using the hierarchy table as a guide, insert it into columns after the date.

I have been trying it for a while and I have found nothing on the internet that can help with this.
Thanks greatly in advance.
 

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

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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