Command Button

  • Thread starter Thread starter Al P
  • Start date Start date
A

Al P

Is there a way I could place a command button on a spreadsheet to call a
complex import VB routine to format the spreadsheet and then delete the
command button???

Thanks.


Al P
 
Hi Al

Yes. But this sounds like a sheet that won't use the VB code more than this
one time for each instance. I'd put the code (in a standard module, not the
sheet module) and a preformatted worksheet into an add-in (SaveAs > xla
file, downmost filetype) and put a button in a toolbar or in a menu that
starts the procedure. When ran, the addin copies the sheet to a brand new
workbook, like this

ThisWorkbook.Sheets(1).Copy

and then imports the data into it. Clean, macro-free and small as possible
file created and your addin file unchanged and ready for reuse.

HTH. Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top