No, the ability to validly transubstantiate bread and wine into the Body and Blood of Our Lord Jesus Christ comes from the sacramental character on an ordained priest's soul in the sacrament of Holy Orders. A layman, because he lacks the sacramental seal of Holy Orders, cannot validly consecrate, not even in a state of emergency.
The same goes for confession; a layman does not have Holy Orders nor jurisdiction from a bishop to validly absolve sins.
Catechism of the Council of Trent on the Eucharist:
ONLY PRIESTS HAVE POWER TO CONSECRATE AND ADMINISTER THE EUCHARIST
[…] to priests alone has been given power to consecrate and administer to the faithful, the Holy Eucharist. That this has been the unvarying practice of the Church, that the faithful should receive the Sacrament from the priests, and that the officiating priests should communicate themselves, has been explained by the holy Council of Trent, which has also shown that this practice, as having proceeded from Apostolic tradition, is to be religiously retained, particularly as Christ the Lord has left us an illustrious example thereof, having consecrated His own most sacred body, and given it to the Apostles with His own hands.
and on confession/penance:
THE USUAL MINISTER
[…] the Sacrament of Penance must be a priest possessing ordinary or delegated jurisdiction the laws of the Church sufficiently declare. Whoever discharges this sacred function must be invested not only with the power of orders, but also with that of jurisdiction. Of this ministry we have an illustrious proof in these words of our Lord, recorded by St. John: Whose sins you shall forgive, they are forgiven them; and whose sins you shall retain, they are retained (John 20:23), words addressed not to all, but to the Apostles only, to whom, in this function of the ministry, priests succeed.
THE MINISTER IN DANGER OF DEATH
In order that none may perish, if there is imminent danger of death, and recourse cannot be had to the proper priest, the Council of Trent teaches that according to the ancient practice of the Church of God it is then lawful for any priest, not only to remit all kinds of sin, whatever faculties they might otherwise require, but also to absolve from excommunication. [Sess. xiv. c. 6. De Poenit.; Code of Canon Law, canon 882.]