Andy Warhol loved cookie jars. So do hundreds of others among the 10,000 who filled Sotheby's galleries yesterday as if it were Bloomingdale's at Christmas time. They came from Florida and Paris and Halifax, Nova Scotia, to browse and bid at the auction of the Pop artist's collection of 175 pottery jars, including pigs, mice, goats, sheep, Humpty Dumpty and a plump panda.

They did not stand much of a chance once Gedalio Grinberg, the chairman of the board of the North American Watch Company in New York raised his arm high in the air and waved his paddle with a threatening smile. Mr. Grinberg said he was a friend of Warhol's who owned some of his artworks and was producing an Andy Warhol watch. He said he came to the sale determined to buy all of the cookie jars. He almost succeeded.

''I got something fabulous,'' he said a half hour later when he had finished bidding, winning 35 of the 39 lots of two, four and five cookie jars each. The lots, which had been estimated to sell for $75 or at most $250 each, brought between $1,980 and $23,100 - the record for a lot of cookie jars sold at auction. Mr. Grinberg spent $198,605 out of the $247,830 paid in this segment of the sale, which Sotheby's had estimated would bring less than $7,000.

''It will be very hard to replace these cookie jars,'' Mr. Grinberg said. ''They're not made anymore,'' Mr. Grinberg said. He said he had expected to spend about that much and had spent more on single purchases of paintings.