ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Found Data Not in Window View (https://www.excelbanter.com/excel-programming/422120-found-data-not-window-view.html)

Ross

Found Data Not in Window View
 
I can successfully find Data in a Pivot table Worksheet called "Pivot" using
this code:

wsPivot.Activate
wsPivot.Columns("C:C").Select

Dim FirstFound As Object
Set FirstFound = Selection.Find(What:=SearchIND_ID, After:=ActiveCell,
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)

If Not FirstFound Is Nothing Then
'MsgBox ("The first location found on Pivot Sheet is:" &
FirstFound.Address)
wsPivot.Range(FirstFound.Address).Select
'Application.Goto Reference:=wsPivot.Range(FirstFound.Address)

Else
'MsgBox ("Nothing was found")
wsGE.Activate
End If

The problem is that if the found/select range is in row 3,267, I must
scroll down 3,267 row to view the .Active (found cell).

How can I get the found record into the current window view so that I don't
have to scroll to it?

Many Thanks

Ross


Rick Rothstein

Found Data Not in Window View
 
The Application.Goto command that you commented out didn't do it for you?

--
Rick (MVP - Excel)


"Ross" wrote in message
...
I can successfully find Data in a Pivot table Worksheet called "Pivot"
using
this code:

wsPivot.Activate
wsPivot.Columns("C:C").Select

Dim FirstFound As Object
Set FirstFound = Selection.Find(What:=SearchIND_ID, After:=ActiveCell,
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)

If Not FirstFound Is Nothing Then
'MsgBox ("The first location found on Pivot Sheet is:" &
FirstFound.Address)
wsPivot.Range(FirstFound.Address).Select
'Application.Goto Reference:=wsPivot.Range(FirstFound.Address)

Else
'MsgBox ("Nothing was found")
wsGE.Activate
End If

The problem is that if the found/select range is in row 3,267, I must
scroll down 3,267 row to view the .Active (found cell).

How can I get the found record into the current window view so that I
don't
have to scroll to it?

Many Thanks

Ross



Ross

Found Data Not in Window View
 
The GOTO code worked identically to the find code.

I removed some other code that was part of code used to populate the A1
lookup cell in the Pivot worksheet.

It was (that I removed):

'Application.ScreenUpdating = False
'Application.ScreenUpdating = True

When I removed this which was not necessary, the .find code began working
properly.

It fixed my problem and now things are working as they should.

Thanks Rick





"Rick Rothstein" wrote:

The Application.Goto command that you commented out didn't do it for you?

--
Rick (MVP - Excel)


"Ross" wrote in message
...
I can successfully find Data in a Pivot table Worksheet called "Pivot"
using
this code:

wsPivot.Activate
wsPivot.Columns("C:C").Select

Dim FirstFound As Object
Set FirstFound = Selection.Find(What:=SearchIND_ID, After:=ActiveCell,
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)

If Not FirstFound Is Nothing Then
'MsgBox ("The first location found on Pivot Sheet is:" &
FirstFound.Address)
wsPivot.Range(FirstFound.Address).Select
'Application.Goto Reference:=wsPivot.Range(FirstFound.Address)

Else
'MsgBox ("Nothing was found")
wsGE.Activate
End If

The problem is that if the found/select range is in row 3,267, I must
scroll down 3,267 row to view the .Active (found cell).

How can I get the found record into the current window view so that I
don't
have to scroll to it?

Many Thanks

Ross





All times are GMT +1. The time now is 10:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com