MATLAB: How to delete cells in Excel and make the adjacent cells move in specific order

activexexcel

I've just learnt that we can actually use ActiveX to manipulate Excel, but not quite familiar yet. I have an Excel file that have words like
'word1:word10' in Column A, sheet 1, '1:20' in Column B.
Now if I want to delete 'word6', the default act would be that 'word7:word10' will move one cell up. However, as I delete the cells 'word8:word10', the default act is moving the digits '8:10' to the left. And this is not what I want. Could you tell me how could I change the actions after deleting some cells? And where can I find more information related to ActiveX for Excel so that I can correct myself? Much appreciated.

Best Answer

The easiest way to figure out the ActiveX commands to do is to record a macro in Excel (not MATLAB). Start recording in Excel. Then do your stuff and stop the recording. Then edit the macro and look at the ActiveX commands it put into the VBA file. Then transfer those to MATLAB with a few minor changes.