I suppose you mean the WorksheetGrid? Normally in a StringGrid, you can validate user input in the OnValidate event. But this event is fired every time when a key is pressed. In case of a spreadsheet, this is too often because this would produce a lot of error messages while typing a formula. It is better to check input when editing is done, i.e. when the user presses the ENTER key or selects another cell. And this is the moment, when the OnEditingDone event is fired.
If you want to restore the previous cell content in case of an input error you must save the previous cell content in the OnGetEditText event since the new text already has been committed to the spreadsheet when OnEditingDone fires.
The following code checks whether the entered text is a number, but reverts it to the previous cell content if it is not between 0 and 100.
var
FOldCell: String;
procedure TForm1.sWorksheetGrid1EditingDone(Sender: TObject);
var
s: String;
x: double;
begin
s := sWorksheetGrid1.Cells[sWorksheetGrid1.Col, sWorksheetGrid1.Row];
if TryStrToFloat(s, x) and ((x < 0) or (x > 100)) then
sWorksheetGrid1.Cells[sWorksheetGrid1.Col, sWorksheetGrid1.Row] := FOldCell;
end;
procedure TForm1.sWorksheetGrid1GetEditText(Sender: TObject; ACol,
ARow: Integer; var Value: string);
begin
FOldCell := Value;
end;