Find the dirty(edited) cell/cells from excel sheet using Excel JavaScript API

懵懂的女人 提交于 2019-12-06 14:50:32

There is no Excel JavaScript API that will return the dirty cells, but it's a good idea. Please suggest it at Office Developer Voice.

Since Excel doesn't natively have a dirty flag, you'll need to produce one via one of two methods:

Catch the cell edit event and record a list of edited cells that are dirty.

Dim Dirty As New Collection

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    Dim sheet As Worksheet
    Set sheet = Sh
    Dirty.Add (sheet.Name + "!" + Target.Address)
End Sub

OR

When you need the dirty flag, open the saved copy behind the scenes and compare the two to see what has changed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!