Version History

  • Thread starter Thread starter rayscar
  • Start date Start date
R

rayscar

How can I keep a record of the version history of a document in Excel such
as on another worksheet?
 
Hi
can you give some more details:
- what kind of version history do you want
- manual or automatic history
- where should this history be stored

Ideally give us a short example :-)
 
I have a schedule for 80 people on a worksheet. It is send out periodically
by email. Employees need to know they have today's most currrent schedule
so I want to include a version history in another worksheet in the file.
Entries into this version history log would be automatically created each
time the scheduler saves the file. The employee can just click on the
worksheet tab named in all likelihood "version" and they can see a log with
columns and data such as:

Filename, version, Updated By
schedule.xls, version 2004.02.14.1601 (year.month.date.military time),
updated by "rayscar"

How can this be done?

Thanks.
Ray
 
Use the workbook level event BeforeSave

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim rng as Range
With worksheets("Version")
set rng = .cells(rows.count,1).End(xlup)(2)
End With
rng.Value = Thisworkbook.name
rng.offset(0,1).Value = "Version " & format(yyyy.mm.dd.hhmm)
rng.offset(0,2).Value = "updated by ""rayscar"""
End Sub

Place in the Thisworkbook module.
 
I don't see a ThisWorkbook module. I see ThisWorkbook under Microsoft Excel
Objects. Is this latter location where the code goes? It just gets pasted
in there, right? Sorry, I'm still learning this.
 
Yep. That's where it goes.
I don't see a ThisWorkbook module. I see ThisWorkbook under Microsoft Excel
Objects. Is this latter location where the code goes? It just gets pasted
in there, right? Sorry, I'm still learning this.
 
Back
Top