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.
Sheets("重新格式化").Column("F").NumberFormat = "$#,##0.000"
为了更好地调试复杂的表达式,请将其分成更小的部分。在你的情况下:
Set sh = Sheets("Reformatted") Set rg = sh.Column("F") Let rg.NumberFormat = "$#,##0.000"
分成多个语句,您可以使用调试器单步执行,并准确找出较大语句的哪一部分导致问题。由于错误发生在 Column 语句上,您可以推断错误消息指的是Column.
Column