A good economy and "huge" investments by customers are to thank for Salesforce's strong first quarter results, CEO Marc Benioff told CNBC on Tuesday.

In an interview with "Mad Money" host Jim Cramer after earnings were released, Benioff said the company had a "fantastic" quarter.

"The economy is really ripping and you can see that customers are going through this massive digital transformation," he said.

Salesforce reported earnings and revenue that beat expectations on Tuesday.