View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Programming for a save button

"Candee " wrote in message
...
Sorry, here it is. The following works perfectly as long as I leave it
in "ThisWorkbook". As soon as I try to move it to "Sheet1(Report) is
when the error happens. Is there a way to create a button and link it
to the code in "ThisWorkbook"?


You could by changing it to a public sub and add this to the button click
event on the sheet

ThisWorkbook.btn_save_Click

but I wouldn't recommende it. If there is a problem, just calling it from a
different place won't solve it, you need to get to the root of the problem.

I would start by adding a Sheets qualifier to all of of the unqualified
Range statements, and then running again. Preferably, step through it to see
where it goes wrong.