Michael D. Barnes had just started to walk to the House floor for a vote when the call came. Leaning out the doorway of Barne's office, receptionist Cleo Forde called after him, "Do you want to speak to the vice president?"

From an airport in Indianspolis, Vice President Walter Mondale was solicting the Montgomery County Democrat's support for the creation of a new Department of Education, which was to come before the House in two days.

Barnes, who had opposed the measure creating the department when it squeaked by the House last July, told Mondale to count on him: the new conference committee report on the bill, he said, met all his earlier objections.

Nonetheless, the efforts to ensure that Barnes had indeed changed his mind -- called "as thorough a lobbying job as I've ever seen" by one of the freshman congressman's aides -- continued until he arrived on the House floor to vote yesterday.

When the final results were counted, Barnes had voted with the majority as the bill creating the department was approved, 215 to 201.

G. Keith Heller, Barnes' administrative assistant, called the lobbying effort "extraordinary in comparison to other issues."

As one of perhaps 50 congressmen whose votes were considered shaky by supporters of the department, Barnes got some special treatment: For 10 days, a parade of administration lobbyists and representatives of the National Education Association and other educational organizations either made sporadic visits to his office or called him up.

Administration lobbyists, one of whom shook Barnes' hand warmly as he walked into the Capitol for the final vote, were anxious both to win approval of a key element of President Carter's governmental reorganization plan and to pull a victory of any sort out of an increasingly balky Congress.

The NEA and 107 other educational and labor organizations were anxious to have a governmental bureaucracy that could devote its undivided attention to their concerns. However, the rival America Federation of Teachers, the ALF-CIO and several major colleges and universities had opposed the measure.

And, when word went out in the country's Spanish-speaking communities that Jerry Apodaca, the former New Mexico governor, would probably be named education secretary, a flurry of phone calls from Hispanics in the Washington area started to come into Barnes' office.

As a result, it was difficult for Barnes and his staff to put the education department out of their minds for more than a few hours at a time, even as they worked on such issues as the Panama Canal legislation and the congressional pay raise.

Early last week, Barnes had breakfast at a Rockville Hot Shoppes restaurant with David Eberly, who heads the Montgomery County Teachers' Association, one of the most powerful labor unions in Barnes' home district.

After Barnes explained that the removal of anibusing and pro-school prayer amendments had cured his most serious objections to the measure, Eberly decided "there wasn't any need to put on any additional pressure."

That decision, however, didn't stop Barnes' office, nor did it halt the buying efforts of the Maryland State Teachers' Union, who were lobbying both Barnes and Baltimore Democrat Parren J. Mitchell, the head of the congressional black caucus.

The calls also were coming into Barnes' office from representatives of the United Auto Workers, the United States Students' Association of University Professors.

Simultaneously, small delegations of educators were dropping by each with its own packet of information, business card and five-minute spiel. "There's never any attempt to set up an appointment," lamented Haller, who dealt with many of these lobbyists. "People don't have any regard for your schedule."

Barnes' own staff was divided on the question, with legislative aides Matt Pinkus and Judy DeSarno opposing the new department and Haller favoring it. Barnes himself said he made up his mind after talking to the acting and outgoing Montgomery County school superintendents and to such consituents as State Sen. Lucille Maurer, an expert on educational management questions.

"I felt all along it was a very close call . . . I've talked to people on both sides . . . But I've heard a relatively uniform ovice from people concerned with education in Montgomery County in support of this."