Excel


Q: Excel, ?

A: :

' Sub GotoFixedCell:
' , vVariant
' sSheetName .
'
' Note: ''!
'
Public Sub GotoFixedCell(vValue As Variant, sSheetName As String)
Dim c As Range, cStart As Range, cForFind As Range
Dim i As Integer

On Error GoTo errhandle:

Set cForFind = Worksheets(sSheetName).Cells '
With cForFind
Set c = .Find(What:=vValue, After:=ActiveCell, LookIn:=xlValues, _
LookAt:= xlart, SearchOrder:=xlByRows,_
SearchDirection:=xlNext, MatchCase:=False)
Set cStart = c
While Not c Is Nothing
Set c = .FindNext(c)
If c.Address = cStart.Address Then
c.Select
Exit Sub
End If
Wend
End With
Exit Sub
errandle:
MsgBox Err.Descrition, vbExclamation, "Error #" & Err.Number
End Sub

int: Auto_Oen()!

int: Excel'97.