MATLAB Answers

Deselect Cells on Excel Sheet

5 ビュー (過去 30 日間)
katerina
katerina 2014 年 12 月 12 日
回答済み: Othmane ELMOUATAMID 2018 年 11 月 12 日
Hello, I am writing a report out to an Excel Workbook, and everything is correct except that I cannot deselect the cells after I've selected them. What is the correct keyword to accomplish this?
Here's the part of code in question:
Excel.Cells.Select;
Excel.Selection.HorizontalAlignment = 2;
%Excel.Selection.Unselect; %this returns an error (no method Unselect)
%Excel.Selection.Deselect; %this returns an error (no method Deselect)
I don't want my users to have to open their workbooks with all highlighted cells - it's pretty annoying. Does anyone know the answer to this??
Thank you!

  0 件のコメント

Sign in to comment.

回答 (1 件)

Othmane ELMOUATAMID
Othmane ELMOUATAMID 2018 年 11 月 12 日
Hello Katerina,
Try to select one cell then Excel will unselect all other cells, for instance select the very first cell of your sheet: Range("A1").Select

  0 件のコメント

Sign in to comment.


Translated by