|
vba中find查找表格中不为空的最大矩形区域,可以按照下面代码Sub 查看区域()
Dim a%, b%, m%, n%
a = Cells.Find("*", , , 1, 1, 1).row
b = Cells.Find("*", , , 1, 2, 1).column
m = Cells.Find("*", , , 1, 1, 2).row
n = Cells.Find("*", , , 1, 2, 2).column
Range(Cells(a, b), Cells(m, n)).Select
End Sub
但是COM中Find的声明如下:
LPDISPATCH Find(const VARIANT& What, const VARIANT& After, const VARIANT& LookIn, const VARIANT& LookAt, const VARIANT& SearchOrder, long SearchDirection, const VARIANT& MatchCase, const VARIANT& MatchByte, const VARIANT& SearchFormat);
要实现上面VBA的效果 应该怎样编码?
请高手指点!多谢!!
|
|