Following the August 2018 resignation of former prime minister Malcolm Turnbull, Sharma was selected as the Liberal Party candidate for the resulting Wentworth by-election. After his preselection, Sharma apologised for an opinion piece published the previous June in the Sydney Morning Herald where he argued that school infrastructure was underused and teachers worked only three-quarters the hours of a full-time job. On 24 September 2018 he was interviewed on ABC Radio National where he stated that he did not believe that the Liberal Party should have quotas for female representation. On 26 September 2018, Sharma's campaign team was accused by other candidates in the by-election of removing their campaign posters and replacing them with Sharma's posters. In response to criticism from John Hewson, Sharma has stated that the Liberal Party has a "good record" on climate change, and is "doing enough" to meet the Paris Agreement. Independent candidate Kerryn Phelps won the by-election, but Sharma has been pre-selected again to run as the Liberal candidate for Wentworth at the next Australian federal election. Subsequently Sharma lost control of the domain name for his campaign web site by failing to renew it.