Macfarlane was born in Kingaroy, Queensland, and was a farmer before entering politics. He was elected to parliament at the 1998 federal election, representing the Division of Groom. Macfarlane was appointed Minister for Small Business in January 2001. After the 2001 election, he was made Minister for Industry, Tourism and Resources, a position he held until the Howard Government's defeat at the 2007 election. Macfarlane returned to cabinet in 2013 as Minister for Industry (later Industry and Science) in the Abbott Government. He lost his position when Malcolm Turnbull became prime minister in September 2015, and retired from politics at the 2016 election. He is currently chief executive of the Queensland Resources Council.