如题,有经验的请明示。

解决方案 »

  1.   


    Sub find()
    Dim result As String
    result = Application.InputBox("请输入你要查找的内容", , , , , , , 2)
    '行号
    Dim i As Integer
    '列号
    Dim j As IntegerFor i = 1 To 10
        For j = 1 To 10
            If Cells(i, j).Value = result Then
            Cells(i, j).Select
            With Selection.Interior
            .ColorIndex = 24
            End With
            End If
        Next j
      Next i
            
    End Sub我用inputbox写了一个根据内容查找单元格的sub,你看看是否能满足你的需要
      

  2.   

    如果写函数的话。可以直接用find方法。可以在整个工作表中去查了。
    而不是10*10的范围,或是65536*256的范围。