简单的Excel代码

时间:2018-07-06 18:05:27

标签: excel

我试图遍历某些单元格,找到单词 Senast ,然后写出消息 hej 。出问题了,我不知道为什么。请帮助:

Sub Find_Data()

Dim item_in_review As Long
Dim row_number As Long



For row_number = 1 To 1000 Step 1
item_in_review = Sheets("Investor_Importerad data").Range("A" & row_number)
    If InStr(item_in_review, "Senast") Then
    MsgBox "hej"
    Exit For
    End If

    If item_in_review = 300 Then
        MsgBox "300"
    Exit For
    End If
Next row_number

End Sub

0 个答案:

没有答案