LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Show if file has been saved

The line of code you'd need to use is something like:

if thisworkbook.saved = true then
'it's saved
else
'it's dirty (not saved
end if

But the bad news is where to put it. You can change lots of things that will
make the workbook dirty, but not fire any event (like changing format, changing
a print title, changing code, ...).

But the very act of changing the format of the cell would make the workbook
dirty. But you could cheat a little and ignore this.

Kind of like this using a worksheet event:

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ThisWorkbook.Saved = True Then
Me.Range("a1").Interior.ColorIndex = 3
ThisWorkbook.Saved = True
Else
Me.Range("a1").Interior.ColorIndex = 6
End If
End Sub

A couple of warnings -- most macros that do anything will destroy the Undo/Redo
stack and clear the clipboard.

Either of these are enough for me not to do this.

I'd just add a macro that displayed the status:

Option Explicit
Sub testme()
With ActiveWorkbook
MsgBox .FullName & vbLf & "Saved: " & .Saved
End With
End Sub

Put it in my personal.xl* file and assign it a shortcut key.

Then run it when I wanted to know.

Rob L wrote:

I have a macro that saves a workbook (locally, and a second time to the
network shared file).

Can I have two cells on the sheet that are (say) Red if the workbook has
unsaved changes, and Green if it has been saved?

Thanks

RobL


--

Dave Peterson
 
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
show last date saved in excel k2224z Excel Discussion (Misc queries) 2 August 29th 06 04:57 PM
Show full path of files being saved JERRY Excel Discussion (Misc queries) 4 May 16th 06 07:57 PM
show the time I last saved my file just hovering a mouse on a butt Rajarshi Shrestha Excel Discussion (Misc queries) 0 April 7th 06 07:54 PM
how do I show last date file saved? Pete Excel Worksheet Functions 1 February 17th 05 06:25 PM
How do I show the last saved date in an Excel worksheet? mgriffie Excel Worksheet Functions 1 January 5th 05 08:46 AM


All times are GMT +1. The time now is 12:21 AM.

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

About Us

"It's about Microsoft Excel"