VBA - JumpTo Specific Row
Hi Kirk,
Selected Cells always have a bold outline. I don't know any way of getting
rid of it.
For you other request insert the following private sub in each worksheet so
that it calls a sub in a module. (Being an event driven procedure it must be
tied to the worksheet):-
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Call Cell_Select(Target)
End Sub
Then insert the following sub in a module so that it can be called from the
event driven procedure in each worksheet. The Target value is passed to it
when it is called:-
Sub Cell_Select(Target)
Dim response As Variant
Dim foundCell As Range
response = InputBox("Enter data to find in column")
Columns(Target.Column).Select
Set foundCell = Selection.Find(What:=response, _
After:=Cells(Rows.Count, Target.Column), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If Not foundCell Is Nothing Then
foundCell.Select
'Place cell in top row of window.
ActiveWindow.ScrollRow = foundCell.Row
'Alternative: Place cell in top left of window
'Application.Goto Range(foundCell.Address), Scroll:=True
Else
MsgBox response & " Not found"
Target.Select
End If
End Sub
I will be out of the picture for a few days but will check back here after
that in case you have any further problems but feel free to post a fresh
request if you want answers before I return.
Regards,
OssieMac
|