+ Reply to Thread
Results 1 to 2 of 2

apply filter when value change cell

  1. #1
    Registered User
    Join Date
    08-17-2005
    Posts
    7

    apply filter when value change cell

    I need help to get this work. I use excel 2007 but this work book is saved excel 97-2003 version.
    I have a sheet where I have data A3 to B500 and I want that user can filter column by value change cell B1, but this is not working. So its not work at all
    Can someone check and give correction?

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    On Error GoTo ErrHandle
    Application.ScreenUpdating = False
    ' when value change cell B1
    If Target.Address = "$B$1" Then

    Application.EnableEvents = False

    Range("B3").Select

    Selection.AutoFilter Field:=2, Criteria1:="*" & Range("B1") & "*"
    Range("B1").Select

    End If
    ErrHandler:
    Application.EnableEvents = True
    Application.ScreenUpdating = True

    This is working when I choose macro by button but I wanted to make filter work automatic when user inser value exampel 105 then result is column B all cells which including 105.

    Sub Suodata_omavalinta()
    Range("B3").Select
    Selection.AutoFilter Field:=2, Criteria1:="*" & Range("B1") & "*"
    End Sub

    I create button which use this macro


    Koodi Nimike
    A-KD10V1 10V TARK.OSAT DINO 105T
    A-KD10V2 10V TARK.OSAT DINO 125T
    A-KD10V3 10V TARK.OSAT DINO 150T
    A-KD10V4 10V TARK.OSAT DINO 150ZX
    A-KD10V5 10V TARK.OSAT DINO 180T
    A-KD10V6 10V TARK.OSAT DINO 180XT
    A-KD10V7 10V TARK.OSAT DINO 210XT
    A-KD10V8 10V TARK.OSAT DINO 260XT

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: apply filter when value change cell

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1