VBA acept data only if Vlookup of offset value equals hlookup of the offset value, then lock cell, if not remove

Fritz S

New Member
Joined
Jun 11, 2021
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Hello am Fritz
Please my final year project is 9 days left to submit and i still have an issue in VBA

On Sheet1 Column D11:D609 different students have to enter their Student ID to select a project.
The Projects numbers are are on sheet1 Column O11:O609

The Student IDs are on sheet4 Column C7:C512 their corresponding departments are in Column F7:F512
The Projects Are on sheet4 Column N7:N100
For each project, there are specific departments that can select it, not just anyone from any department
The departments that can select a specific project are listed in the same row as the project number in array P7:Y106

To select a project on sheet4, you enter just your student ID in any cell in Sheet1 column D11:D609

If the VLookup of your Student ID in sheet4 C7:F512 offset (0,3), that is your department, if this department is also an element of HLookup of the Project number's departments in Sheet 4 then, enter value and lock cell otherwise remove value MsgBox "You cannot select this project"

Thank you. Attched is the excel file
FritzProject.jpg
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,215,701
Messages
6,126,311
Members
449,308
Latest member
Ronaldj

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