RedFox
RedFox

Reputation: 1366

how to identify modified cells of a datatable?

MY users want to download data into a spreadsheet, modify and then upload to save it. I have written a feature to download table into a tab separated file and upload the modified file. Now they want to review it before clicking "save". Wondering if there is any easy way to highlight modified cells.

PS: yes. some refuse to use any other tool. They love their spreadsheets.

Upvotes: 2

Views: 270

Answers (2)

KingChicken
KingChicken

Reputation: 164

If I understand the question, you want changed values to be denoted with a color or some equivalent identifier, you can do this with a simple macro in Excel:

Right click the tab you want to include the macro on and select "View Code", then type the following VBA:

Private Sub WorkSheet_Change(ByVal Target as Range)
    Target.Interior.ColorIndex = 6
End Sub

This will make the background change for any modified cell to bright yellow.

You will need to modify the "download excel" function to supply a .xlsm file from your site and use a templated file on the server (look into EEPlus for serving up Excel files from .NET - supports templating) that contains the macro for this to work. If that is not possible, you could go the harder route and develop a custom Excel Add-In that tracks changes, but this would need to be deployed to each users workstation / Excel install..

Upvotes: 0

test1
test1

Reputation: 11

Add an additional column checksum that is the hash of all the values retrieved from database and before saving re calculate the hash and highlight the cells that are modified.

Upvotes: 1

Related Questions