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.
我使用长变量来表示列和行。当我尝试按类型指定范围时,sheetname.range(cells(i,j), cells(i+1, j+1))出现方法Range of Object Worksheet failed错误。
sheetname.range(cells(i,j), cells(i+1, j+1))
Range of Object Worksheet failed
关于在使用长变量作为单元格引用时如何使用范围的任何想法?
sheetname.Range(sheetname.Cells(i,j), sheetname.Cells(i+1, j+1))
不合格Cells()将始终引用活动表。
Cells()
我宁愿使用:
sheetname.Cells(i,j).Resize(2,2)