exceldata-connections

Updating data connection adds values but moves previous data in Excel


So, I have a table that gets updated data from Smatsheet, this information is then used in a macro that flags each row that has been processed so the next time these rows won't go trough the same process. The problem is that every time I update the data connection, the information gets added but the flag doesn't stay on the row it was added. It looks a like this:

Table before using the macro:

enter image description here

After using macro:

enter image description here

And this is after updating the data connection:

enter image description here

I'm adding the flag with this code on the macro:

db.DataBodyRange(i, 20).Value2 = 1    
db.DataBodyRange(i, 21).Value2 = 1

Any suggestion would be appreciated.


Solution

  • I had the same problem and solved it by changing how Excel updates the table. Go to Table Design > Properties. Select "Overwrite existing cells with new data, clear unused cells." Cheers.

    Excel Table Design - External Data Properties