s.41 Administration of Estate Act 1925 is the statutory provision governing appropriation, although can be modified by the terms of the will.
In the absence of any specific/modifying terms in the will, the consent of the beneficiary to the appropriation is required.
As regards the value to be used, this will be as at the date of appropriation (Re Charteris  and not the value as at the date of death, no matter how inconvenient that might be felt to be. For CGT purposes, though, the beneficiaries will be deemed to have acquired at the date of death value (s.62(4) TCGA 1992).
Whilst the Special Provisions of the STEP Standard Provisions (2nd Edition) , if incorporated, allow an executor to appropriate at the date of death value, HMRC has previously stated that this could give rise to a transfer of value between beneficiaries.
The starting point must be the communication to the charity, identifying the assets that it is proposed be appropriated to them and seeking confirmation both that the charity consents to the appropriation, and directs that any such shares appropriated be sold immediately after appropriation. It may be that the Charity might want some of the shares transferred.. Whilst it may be acceptable to then use the sale price as the value for the appropriation, the transaction costs will be payable by the beneficiary without reducing the value of the appropriation.