Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
GARY
 
Posts: n/a
Default Changed worksheet file (Excel 2003)

Is there any indicator that can be displayed to alert the user that
un-saved changes have been made to a worksheet?

(In some other applications, an asterisk ( * ) is displayed next to the
file-name in the Title Bar).

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Changed worksheet file (Excel 2003)

I'd use a macro in my personal.xls file. It wouldn't be the same as the
asterisk indicator (UltraEdit???), but it might be sufficient:

Option Explicit
Sub testme01()
With ActiveWorkbook
MsgBox prompt:="Last changes have been saved: " & .Saved, _
Title:=.FullName
End With
End Sub

Assign it to a button on your favorite toolbar or give it a shortcut key.

==========
You could use something like this, but it has a problem:

It checks each time you change the selection to see if the workbook has been
saved. So it could be off by one selection.

If you save the workbook, then the indicator won't change from book1.xls* to
book1.xls until you select a different cell in that same workbook.

If you want to try, you could use something like this:

Option Explicit
Public WithEvents xlApp As Excel.Application
Private Sub Workbook_Open()
Set xlApp = Application
End Sub
Private Sub Workbook_Close()
Set xlApp = Nothing
End Sub
Private Sub xlApp_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)

Dim myStr As String

myStr = Sh.Parent.Name

If Sh.Parent.Saved = False Then
myStr = myStr & "*"
End If

ActiveWindow.Caption = myStr

End Sub

This is an application event. Put this into a workbook that's always opened
when you open excel.

One possible workbook is your personal.xls stored in your XLStart folder.
Another possible workbook is an addin (located anywhere you want), but installed
via tools|addins.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

If you want to read more about these kinds of events:

Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm

And you can read about application events on Chip's site:
http://www.cpearson.com/excel/AppEvent.htm



GARY wrote:

Is there any indicator that can be displayed to alert the user that
un-saved changes have been made to a worksheet?

(In some other applications, an asterisk ( * ) is displayed next to the
file-name in the Title Bar).


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saved *.csv file gives SYLK file type warning upon Excel 2003 open Tom Excel Discussion (Misc queries) 5 March 19th 08 03:15 PM
combine multiple excel file in to one excel file and multiple worksheet jbhoop Excel Discussion (Misc queries) 0 December 29th 05 04:59 PM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
VBA for Excel 2000 file is corrupt nkamp Excel Discussion (Misc queries) 0 May 26th 05 03:37 PM
Opening and saving Excel 2003 file from Excel 97. Rodrigo Excel Discussion (Misc queries) 2 December 12th 04 02:17 PM


All times are GMT +1. The time now is 04:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"