|

楼主 |
发表于 2011-3-1 22:19
|
显示全部楼层
原帖由 lu_zhao_long 于 2011-3-1 19:14 发表 
试试看。2003 及 2007 下均可用!
With ActiveSheet
.Cells(5, .Cells.Columns.Count).End(xlToLeft).Offset(0, 1) = Application.WorksheetFunction.CountA(.Range(.Cells(5, 3), .Cells(5, .Cells.Columns ...
我也使用了这种.下午已经能解决了..谢谢您~
但是还有一个问题就是我以上代码统计了的个数出来不能写进if公式里.是什么原因呢?应该如何修改吖?
j = ActiveSheet.Cells(5, 255).End(xlToLeft).Column + 1
ActiveSheet.Cells(5, j) = j - 3
With Application
ActiveSheet.Cells(6, j) = "=IF(Application.WorksheetFunction.CountA(Range(Cells(6, 3), Cells(6, j - 1))) = j - 3,""OK"",""NG"")"
End With |
|