Shares of Clorox (CLX) are rallying Wednesday after the company beat on earnings per share and revenue expectations. This was a "great quarter," according to TheStreet's Jim Cramer, who spoke on CNBC's "Stop Trading" segment.

Sales climbed 4.2% to $1.5 billion in the quarter, while margins increased by 50 basis points to 44.9% in the quarter. Those are Clorox's best margins in years, as sales in each segment increased year over year. Surprisingly, though, shares are still up despite a slight clip in full-year guidance for both sales and earnings.

Interestingly enough, CEO Benno Dorer, who is a "genius," was previously with Procter & Gamble (PG) for 14 years and passed over as CEO, Cramer pointed out. Now he comes to Clorox and is doing a magnificent job.

He "quietly built one of the greatest consumer-product stories," Cramer added. Dorer is great at using the internet to boost sales, something Cramer correctly pointed out more than a year ago.

However, sailing would be rough if not for prior CEO Don Knauss. In September 2014, he announced the company would cease operations in Venezuela and later announced that Dorer will be the new CEO going forward. This move proved extremely beneficial and many other U.S. companies wished they had done the same. At first, some investors thought of all the lost market share, but in hindsight it was one of the company's best moves.

They bit the bullet and it was worth it, Cramer concluded.

Clorox stock couldn't hold its early gains, closing up just 1.11% to $128.02 Wednesday. 

More of What's Trending on TheStreet:

At the time of publication, Cramer's Action Alerts PLUS had no position in any companies mentioned.

More from Stocks

Listen Carefully for These Clues of an Economic Slowdown

Listen Carefully for These Clues of an Economic Slowdown

Exxon Mobil Can Be Bought Here for an Upside Move

Exxon Mobil Can Be Bought Here for an Upside Move

Electronics for Imaging Tanks After Revising Guidance Lower

Electronics for Imaging Tanks After Revising Guidance Lower

Stocks Rise, Dow Trades Higher as Goldman Sachs Jumps After Strong Earnings

Stocks Rise, Dow Trades Higher as Goldman Sachs Jumps After Strong Earnings

Snap Shares Dive as CFO Stone Resigns After Eight Months With Messaging Group

Snap Shares Dive as CFO Stone Resigns After Eight Months With Messaging Group