필터 지우기
필터 지우기

Deselect Cells on Excel Sheet

조회 수: 4 (최근 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!

답변 (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

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by