Using a button to export multiple records

I typically use the gear to export a selection of records to a CSV/Excel sheet.  What I would like to do is do this using a button.  How does one code for this?  

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like Follow
  • 5 mths agoLast active
  • 30Views
  • 1 Following