阅读背景:

验证列只应存在数值

来源:互联网 

i have written a code

我写了一个代码

  Sub CellCheck()
  Dim Header(1 To 2) As String
   Header(1) = "Header1" 'header name
   Header(2) = "Header2"  'header name
   Dim rCell As Range
   Dim sMyString As String
   On Error GoTo ErrorHandle
   Set rCell = Range("A:A)
   If IsNumeric(rCell.Value) = False And _
   IsError(rCell.Value) = False Then
   'assuming Error_sheet already present 
   Sheets("error_sheet").Range("A" & row).Value = "There are " & 
   Application.WorksheetFunction.IsNumeric(r) & " Rows with error in column" & 

   Header(i)
   On Error GoTo ErrorHandle
   Set rCell = Range("B:B)
   If IsNumeric(rCell.Value) = False And _
   IsError(rCell.Value) = False Then
   Sheets("error_sheet").Range("A" & row).Value = "There are " & 
   Application.WorksheetFunction.IsNumeric(r) & " Rows with error in column" & 
   Header(i)
  End sub
  Sub CellChe



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: