Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
下面是一些 Excel VBA 代码,它应该打印字符串中指定范围的列数。我在该Debug.Print部分中遇到错误。我究竟做错了什么?
Debug.Print
Dim val1a As String val1a = "A1:D1" Dim Rng1 As Range Debug.Print Rng1(var1a).Columns.Count ' error here
采用
Range(var1a).Columns.Count
你犯的错误是,
您声明了“val1a”,但调用了“var1a”。
更正错字,您将能够得到它。