Auto deleting a date column once the date has passed via VBA

RMH2024

New Member
Joined
Nov 23, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello,

My practice uses excel spreadsheets to track resourcing requirements on a week to week basis, this is done for an 18 month period. The week commencing date starts at Column C with the date in row 1. Column B notes employees names, each row has one employee name. The total hours per employee sit in column c in the relevant week date next to their name.

Can you help provide a code that deletes the week commencing date when the following week starts? Then I’d need (if possible) a code that adds a week to the end. I want the excel sheet to have a constant rolling 18 month period.

Thanks. 🙏
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hello,

My practice uses excel spreadsheets to track resourcing requirements on a week to week basis, this is done for an 18 month period. The week commencing date starts at Column C with the date in row 1. Column B notes employees names, each row has one employee name. The total hours per employee sit in column c in the relevant week date next to their name.

Can you help provide a code that deletes the week commencing date when the following week starts? Then I’d need (if possible) a code that adds a week to the end. I want the excel sheet to have a constant rolling 18 month period.

Thanks. 🙏
Welcome to Mr Excel.

Are you able to post your data using XL2BB?

It will help people in coming up with the most suitable solution.

https://www.mrexcel.com/board/help/xl2bb/
 
Upvote 0
Team Resourcing.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1Staff Member18-Nov25-Nov02-Dec09-Dec16-Dec23-Dec30-Dec06-Jan13-Jan20-Jan27-Jan03-Feb10-Feb17-Feb24-Feb03-Mar10-Mar17-Mar24-Mar31-Mar07-Apr14-Apr21-Apr28-Apr
2Weekly Total Hours
3RH1714212135353514141414444400000353500
4DM000000000000000000000000
5JH772121353535171710100000000000000
6000000000000000000000000
7000000000000000000000000
8000000000000000000000000
9Annual Leave
10RH77773521353535
11DM
12JH777353535
13
14
15
16Time on other Assoc jobs
17RHHHH
18DM
19JH1021HH17171010
20
21
22
23Practice Management & Ad Hoc
24RH10H14HH
25DM
26JH4HH
27
28
29
30Project
31Work StageStage 3 - 140 Hours
32Total Target Hours:RH71414H141414144444HH
33DM
34Hours to Date:JHHH
35
36
37Hours Remaining:
38-107Total071414000141414144444000000000
Resource Planner
Cell Formulas
RangeFormula
C3C3=SumColoredCells($B$3,C10:C914)
D3:Z3D3=SumColoredCells($B$3,D10:D914)
C4C4=SumColoredCells($B$4,C10:C914)
D4:Z4D4=SumColoredCells($B$4,D10:D914)
C5:Z5C5=SumColoredCells($B$5,C10:C914)
C6:Z6C6=SumColoredCells($B$6,C10:C914)
C7:Z7C7=SumColoredCells($B$7,C10:C914)
C8:Z8C8=SumColoredCells($B$8,C10:C914)
A38A38=A33-(A35+SUM(D38:Z38))
C38:Z38C38=SUM(C31:C37)
Press CTRL+SHIFT+ENTER to enter array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A38Cell Value<0textNO
A38Cell Value>0textNO
C7:Z7Cell Value=35textNO
C7:Z7Cell Value>35textNO
C3:Z6,C8:Z8Cell Value=35textNO
C3:Z6,C8:Z8Cell Value>35textNO
 
Upvote 0

Forum statistics

Threads
1,223,996
Messages
6,175,869
Members
452,679
Latest member
darryl47nopra

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