Name
workbook.AcceptAllChanges([When], [Who], [Where])
Synopsis
For shared workbooks, commits the changes to the workbook.
|
Argument |
Settings |
|---|---|
|
|
A string indicating the time after which to accept changes |
|
|
A string indicating the user from which to accept changes |
|
|
A string indicating a range of cells for which to accept changes |
It’s easiest to see the effect of AcceptAllChanges when you combine it with RejectAllChanges. For example, the following code accepts all of the changes made to the range A2:D4, but rejects changes to other cells if they were made within the last minute:
If ThisWorkbook.MultiUserEditing Then
[a1] = "Value rejected": [b2] = "Value kept"
ThisWorkbook.AcceptAllChanges , , "$A$2:$D$4"
' Reject other changes made in the last minute.
ThisWorkbook.RejectAllChanges CStr(Now - 0.001)
End IfBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access