Macro to lock and protect the sheet for everything but todays date?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi everyone,
I have a spreadsheet with a tab called daily expenses,
the data has a list along the top of this months dates so form 01/09/14 to 30/09/14
I work with some pretty stupid people who cant even enter there expenses in the right column (they just see "petrol" and start typing,


so I want to lock down every column except the ones that have todays date on it?
now to make it simpler cell A1 will hold the date I'm referencing (todays date) but must stay locked and we start at column B, there is more than one column with todays date but to make it Simpler I've put the date in every column in row 1 see below for example.

So to summaries I want a macro that automatically runs will lock all columns in the workbook but unlock the columns with a date in row 1 that matches the date in A1

any ideas guys?
basic example:
04/09/201401-Sep02-Sep03-Sep04-Sep04-Sep04-Sep05-Sep06-Sep
lockedthese Columns locked unlockedunlockedunlockedthese Columns locked

<COLGROUP><COL style="WIDTH: 50pt; mso-width-source: userset; mso-width-alt: 2858" width=67><COL style="WIDTH: 42pt" span=8 width=56><TBODY>
</TBODY>
and them tomorrow because the date changes the unlocked cells get locked and new cells get unlocked
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,214,556
Messages
6,120,190
Members
448,949
Latest member
keycalinc

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