Ensure Data Entry in Excel

How to ensure that all data is entered properly into specific worksheet cells in Excel

So you have protected the worksheet and unlocked only the spreadsheet cells into which data will be entered. You have also provided proper headers against the unlocked cells. The user still forgets to enter all the data. What can we do? Well, we can warn the data entry operator if she misses her entry and also guide her about which data she has forgotten so that she can take corrective action. Since we are in the process of creating a macro using VBA we might as well introduce some automation so that the job becomes even easier. The code that we wrote is given below:

Sub calculate()

‘ calculate Macro
‘ ‘ Keyboard Shortcut: Ctrl+t

If Cells(3, 3) = “” Then
MsgBox “Please enter the item description”
End If
‘ Here we introduce an icon also in the warning
If Cells(4, 3) = “” Then
MsgBox “Please enter the Unit Price”, vbCritical
End If
If Cells(5, 3) = “” Then
MsgBox “Please enter the Quantity”, vbCritical
End If
Cells(6, 3) = Cells(4, 3) * Cells(5, 3)
‘Tax is assumed to be 5%
Cells(7, 3) = Cells(6, 3) * 0.05
Cells(8, 3) = Cells(7, 3) + Cells(6, 3)
End Sub

Watch the training video to understand the solution thoroughly!

Further reading:
Warn the User of empty cell and indicate the location based on values in preceding columns

One thought on “Ensure Data Entry in Excel

  1. India

    negli orologi sportivi ma anche in ricevitori GPS potenti e compatti ed in caunqofreiredzimetri, la Garmin è stata una delle aziende leader preferita da atleti e professionisti del settore per un bel po


Leave a Reply

Your email address will not be published. Required fields are marked *