View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default open & scroll to specific location based on value

Private Sub Workbook_Open()
Dim rng as Range
with ThisWorkbook.Worksheets(1)
set rng = .Columns(2).Find(What:="ABCD", _
After:=.Range("B65536"), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If not rng is nothing then
Application.Goto rng, True
Else
Application.Goto .Range("B1"), True
End if
End With
End Sub

You might have to change some of the parameter settings so it finds you
search target (if it is produced by a formula, then you would change LookIn
to xlValues rather than xlFormulas, as an example). Change What:="ABCD" to
your target value.

Put this in the ThisWorkbook module.

--
Regards,
Tom Ogilvy

"paul" wrote in message
...
Hello Gurus and News Group users.

You’re kind assistance please.

I am trying to open a worksheet at specific location. Not
a cell reference but the first cell that has a specific
value.

The value is within a specific column (column 2) but the
row location does vary.

I have looked at the Goto method, but this seems to look
at specific cell references.

Any help would be appreciated.

PW