Macro help ---> Sort

bluepenink

Well-known Member
Joined
Dec 21, 2010
Messages
585
Hello

Im new with Macro and I have this macro in place that filters when I enter a number in cell H4 on worksheet called "Report".

Basically, I list of 900+ accounts, so this macro can filter by only the accounts i would want. ie. If i enter 0987 in cell H4, the table below would filter the results to show data pertaining to 0987.

Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
    Application.ScreenUpdating = False
    With ActiveSheet
        .AutoFilterMode = False
        .Range("myHeaders").AutoFilter
        If Range("myStoreNumber").Value <> 0 Then .Range("myHeaders").AutoFilter Field:=6, Criteria1:=Range("myStoreNumber").Value
    End With
    Application.ScreenUpdating = True
End Sub

ISSUE:
On my new worksheet, called "OMX Store Summary" I would like the same macro to work in cell D6. How can I re-route this macro to lookoff worksheet "Report" and take me to that worksheet with the result?

Can someone pls help?! cheers
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Can you be more specific? Do you mean enter a filter value in D6 of sheet OMX Store Summary, and the macro would then take you to sheet Report, filter with that value just entered?

Or do you mean enter a value into sheet Report, cell H4, it filters the results and then takes you to the worksheet that has the same name as the filter value? What happens if the filter value does not match a worksheet name?
 
Upvote 0
Hello

Thnx you for your prompt response! *life saver*

Basically, either or works.

If a person enters a value aka store # in cell D6 of "OMX Store summary", i would to macro to take me to worksheet "report" and filter by the store number".

Currently I have the posted macro in worksheet "report" and it works great, however, I want it to be added to "OMX Store summary" worksheet as that is the main summary page?

I REALLY APPPRECIATED YOUR HELP!

cheers!
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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