VBA 在带有数字的列中查找第一行号?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19713114/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 00:10:01  来源:igfitidea点击:

VBA Find a first row number in a column with numbers?

excelvbarow

提问by user2703472

I have a column and i would like to find a first row (from top) which contains numbers ,numbers can be -0.0001 or 10 or 0.123.

我有一列,我想找到包含数字的第一行(从顶部),数字可以是 -0.0001 或 10 或 0.123。

Any idea how to write?

知道怎么写吗?

Thanks

谢谢

采纳答案by Gary's Student

Perhaps:

也许:

=MATCH(TRUE,INDEX(ISNUMBER(A1:A100),0),0)

=匹配(真,索引(ISNUMBER(A1:A100),0),0)

In VBA, if there are just blanks above that first number, then:

在 VBA 中,如果第一个数字上方只有空格,则:

Sub luxation()
    MsgBox Range("A1").End(xlDown).Row
End Sub

In VBA, If there is text above that first number, then:

在 VBA 中,如果第一个数字上方有文本,则:

Sub NumberSearch()
    For i = 1 To Rows.Count
        If IsNumeric(Cells(i, "A").Value) And Cells(i, "A").Value <> "" Then
            MsgBox i
            Exit Sub
        End If
    Next i
End Sub