View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Select 1st cell of specified sheet in before close event

I wouldn't use the workbook_beforeclose event. If you do, you'll have to make
sure that you save. If you don't save, then the selection change isn't really
done.

If you do save (and the user just wanted to close without saving), then you may
be saving some bad changes!

I'd use the workbook_Open event.

Option explicit
sub workbook_Open()
application.goto worksheets(1).range("a1"), scroll:=true
end sub



DK wrote:

Hello!

I need help in creating a before close event. If the workbook has 16
sheets and the users saves it with the cursor in any sheet, a before
close event should be called which will ensure that the cursor is
placed in the first cell of the first sheet.

Can someone please assist me in this?

Thanks! - DK


--

Dave Peterson