Feed the pigs and don’t touch anything!

We’ll use a quote from a familiar joke as an introduction to a problem you might encounter in everyday work: how to get the user to enter data only in a predefined cell group? There are several ways to achieve this, and one of the easiest is to format these cells in the desired manner (eg, set a specific background color) and to prevent entry into the cells that are not formatted in a given manner.

For start, let’s create a simple form in which to enter employee information. We will set the background color of the worksheet to light gray and change the format of a few more table elements. Cells that are allowed to enter content will be formatted to have a white background color.

How do we mark these cells as the ones where the entry is made? Applying the CTRL + F shortcut will open the Find and Replace window. After this, you need to click on the Options button to display the advanced options. Open the Format menu, then select Choose Format From Cell and click on one of the cells with a white background.

Then click Find All. Selecting this option will find all the cells within the worksheet that are formatted to have a white backbround color.

Select all cells in the list (CTRL + A) and you will see that selection is being done in the worksheet. Now all you have to do is open the Format Cells window (CTRL + 1) and deselect the Locked field on the Protection tab. Next, we should protect the Worksheet (Review/Protect Sheet) by entering a password and choosing only the option that allows entering values only within cells that have the “Unlocked” attribute checked.

After completing this procedure, it will be possible to enter only cells with a white background, which was our goal from the beginning.