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

2 views (last 30 days)
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.

Accepted Answer

Image Analyst
Image Analyst on 21 Sep 2015
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.
  1 Comment
Liwei Dai
Liwei Dai on 21 Sep 2015
Thanks, that's really a helpful way to learn ActiveX commands, but regarding the minor changes, how could I figure that out?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!