简体   繁体   English

如何遍历特定列中的单元格

[英]How to Iterate through cells within particular columns

I have a spread sheet and I am trying to set a backColor for cells with empty values of some particular columns .我有一个电子表格,我正在尝试为具有某些particular columns的空值的单元格设置背景颜色。 Presently, I can iterate through the spread sheet and set the backColor for all cells with empty values, but I want to narrow it down to only check particular columns .目前,我可以遍历电子表格并为所有具有空值的单元格设置 backColor,但我想将其缩小到仅检查particular columns For instance if I have columns Name , Location , Age , Net worth , Occupation .例如,如果我有列NameLocationAgeNet worthOccupation I want to loop through cells within Age and Occupation columns alone, instead of all.我想单独遍历AgeOccupation列中的单元格,而不是全部。

Thank you for using GrapeCity SpreadJS.感谢您使用 GrapeCity SpreadJS。 I think a better option than iterating through cells is to apply the formatting to the range.我认为比遍历单元格更好的选择是将格式应用于范围。 for example getRange("C:C").backColor("red");例如 getRange("C:C").backColor("red"); would set the background to red for the whole column.会将整个列的背景设置为红色。

if you only want to set empty values, then conditional formatting would be better.如果您只想设置空值,那么条件格式会更好。

you can contact our support team at www.grapecity.com and they can help review your code and provide a more specific example.您可以通过www.grapecity.com联系我们的支持团队,他们可以帮助检查您的代码并提供更具体的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM