Your code assumes that the currently selected cell is in a table - not a good idea. You would be better off specifying the listobject you want to refresh, either by name or index number.