Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Execute script before save

1 view
Skip to first unread message

daw...@gmail.com

unread,
May 1, 2007, 2:35:20 PM5/1/07
to
Hello everyone!

Due to some very finicky software I must move focus cell on every
sheet to cell A1 before submitting spreadsheet for further processing.
My knowledge of VBScripting is very limited hence I'm asking these
questions:

1. How do I intercept the save event?
2. How do I iterate through all sheets in spreadsheet and move the
focus cell to A1?

Your help will be greatly appreciated!

Thanks,
Dawid

daw...@gmail.com

unread,
May 1, 2007, 4:12:16 PM5/1/07
to
To answer my own post:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheet(1).Activate
Sheet(1).Range("A1").Select
End Sub

Alternatively one can put sheet name in quotes instead of number.

Dawid

0 new messages