Macro by filter

bluepenink

Well-known Member
Joined
Dec 21, 2010
Messages
585
Hello having an issue with the macro

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
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,224,507
Messages
6,179,183
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top