bluepenink
Well-known Member
- Joined
- Dec 21, 2010
- Messages
- 585
Hello having an issue with the macro
it is for some reason not taking me to the exact cell the account # is listed in?
i.e. i am trying to search for account 1132, so in my cell D6 i type in 1132 and it takes me to the correct worksheet in "report" but i would like the macro to take me to the row that number is listed on...any ideas,,,stuck? thxs
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
If Target.Address <> Range("D6").Address Then
Application.EnableEvents = True
Exit Sub
Else
Sheets("Report").Select
Sheets(2).Range("I4").Value = Sheets(1).Range("D6").Value
With ActiveSheet
.AutoFilterMode = False
.Range("myHeaders").AutoFilter
If .Range("myStoreNumber").Value <> 0 Then .Range("myHeaders").AutoFilter Field:=6, Criteria1:=.Range("myStoreNumber").Value
End With
End If
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
it is for some reason not taking me to the exact cell the account # is listed in?
i.e. i am trying to search for account 1132, so in my cell D6 i type in 1132 and it takes me to the correct worksheet in "report" but i would like the macro to take me to the row that number is listed on...any ideas,,,stuck? thxs