码迷,mamicode.com
首页 > 编程语言 > 详细

VBA 判断单元格是否为公式,可用于数组

时间:2015-09-06 12:45:17      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:

Function ISFORMULA(ByVal rg As Object) As Variant
      Dim temp As Variant
      Dim i As Integer, j As Integer
      temp = rg.Formula
     
      If IsArray(temp) Then
         For i = 1 To UBound(temp, 1)
            For j = 1 To UBound(temp, 2)
               temp(i, j) = IIf(InStr(temp(i, j), "=") > 0, True, False)
            Next j
         Next i
      Else
         temp = IIf(InStr(temp, "=") > 0, True, False)
      End If
      ISFORMULA = temp
End Function

VBA 判断单元格是否为公式,可用于数组

标签:

原文地址:http://www.cnblogs.com/lbnnbs/p/4784926.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!