错误?将注释添加到非连续范围时出错 [英] Bug? Error while adding a comment to a non-contiguous range

查看:119
本文介绍了错误?将注释添加到非连续范围时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用VBA向命名范围添加注释。通常没问题:



$
使用ActiveWorkbook.Names("TestRange")

         .Name =" TestRange"

        .RefersToR1C1 =" = Tabelle1!R13C6"

        .Comment =" Test"

End with



但如果范围有非连续区域,我会收到错误信息。



使用ActiveWorkbook.Names("测试范围")

        .Name =" Testrange"

        .RefersToR1C1 =" = Tabelle1!R13C6,Tabelle1!R16C8" b
        .Comment =" Test"

End with



任何解决方案?

I want to add a comment to a named range with VBA. Normally it is no problem:


With ActiveWorkbook.Names("TestRange")
        .Name = "TestRange"
        .RefersToR1C1 = "=Tabelle1!R13C6"
        .Comment = "Test"
End With

But if the range has non-contiguous areas, I get an error message.

With ActiveWorkbook.Names("Testrange")
        .Name = "Testrange"
        .RefersToR1C1 = "=Tabelle1!R13C6,Tabelle1!R16C8"
        .Comment = "Test"
End With

Any solutions?

推荐答案

错误信息是什么?假设名称已存在,我可以无错误地运行代码。
What is the error message? I can run the code without error, assuming that the name already exists.


这篇关于错误?将注释添加到非连续范围时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆