我希望能从功能区控件中获取活动范围。应该有一种方法可以在需要时仅访问所选单元格,而不是在所有情况下都进行访问。
目前,我是这样做的:
目前,我是这样做的:
public partial class ThisAddin
{
private void SheetSelectionChange(object sh, Range target)
{
int count = target.Count;
if (count < 5000) // This is for performance reasons
{
//Set a custom range property in the office ribbon
Req_Tool.ActiveRange = target;
{
}
}
我觉得这样做很虚弱而且浪费。
首先,每当选择更改时,我的代码都会运行。
其次,无论是否使用,我都有两份选择。
一定有一种更好的方法可以解决这个问题,但我可能忽略了它。