Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
show last date saved in excel | Excel Discussion (Misc queries) | |||
Show full path of files being saved | Excel Discussion (Misc queries) | |||
show the time I last saved my file just hovering a mouse on a butt | Excel Discussion (Misc queries) | |||
how do I show last date file saved? | Excel Worksheet Functions | |||
How do I show the last saved date in an Excel worksheet? | Excel Worksheet Functions |