+ Reply to Thread
Results 1 to 9 of 9

Remove A Filter Arrow?

  1. #1
    Forum Contributor
    Join Date
    02-19-2007
    Location
    Poole England
    MS-Off Ver
    2010
    Posts
    117

    Remove A Filter Arrow?

    hello All.
    I'm trying to remove 1 filter arrow.
    For cross posting purposes I have posted here;
    http://www.mrexcel.com/forum/showthread.php?t=613629

    A guy called SHG (A Great contributor by the way, really,,) got back to me and mentioned a link whic was here;
    http://contextures.com/xlautofilter03.html#Hide

    this actually was really informative,, many ways to remove filter arrows depending on where they start from etc etc.

    I did try one suggestion, I think I coded it correctly but got a
    debug error in VB,, and it shows these lines of code in yellow;
    Please Login or Register  to view this content.
    My formula by the way was;
    Please Login or Register  to view this content.
    Does anybody know how I can fix tis please?
    I do have a sample sheet here;
    http://dl.dropbox.com/u/16052166/hid...est-sheet.xlsm

    All I'm looking to do is hide F4 drop down arrow filter in my sheet.

    I hope somebody can advise.

    many Thanks
    TheGhost
    Last edited by theghost; 02-15-2012 at 01:17 PM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Remove A Filter Arrow?

    Did you apply the filter before you ran the code? Its not visible in the code hence i applied the filter and then ran it. And it works fine.

    Alternatively you can add this line of code
    Please Login or Register  to view this content.
    before the For Each code line.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Remove A Filter Arrow?

    Another way:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    02-19-2007
    Location
    Poole England
    MS-Off Ver
    2010
    Posts
    117

    Re: Remove A Filter Arrow?

    Many Thanks for your reply arlu1201,,,
    You say "It worked fine." ,,Humm,, I'm not getting that here:-(
    Not with the code I posted above,,,,
    Just tried it adding your 1 line of code,, so it is now;

    Sub HideArrowsRange()
    'hides arrows in specified range
    Dim c As Range
    Dim i As Integer
    Dim rng As Range
    Set rng = Range("B4:J4")
    i = rng.Cells(1, 1).Column - 1
    Application.ScreenUpdating = False

    Range("B4:J4").AutoFilter
    For Each c In Range("B4:J4")
    Select Case c.Address
    Case "$F$4"
    c.AutoFilter Field:=c.Column - i, _
    Visibledropdown:=False
    Case Else
    c.AutoFilter Field:=c.Column - i, _
    Visibledropdown:=True
    End Select
    Next

    Application.ScreenUpdating = True
    End Sub
    [/code]

    And,,,, It Works!!!!!!!!!
    I still don't get it to work as you say you can without the line of code you suggested to add arlu1201.

    But hey,, it's working now.

    Many thanks for this..
    Screen shot attached,, beautiful!! :-)
    \1
    Many thanks again arlu1201,,,
    I can apply this else where now in my workbook.

    All the best
    A very grateful
    TheGhost

  5. #5
    Forum Contributor
    Join Date
    02-19-2007
    Location
    Poole England
    MS-Off Ver
    2010
    Posts
    117

    Re: Remove A Filter Arrow?

    Sorry again,,,,,,,,,
    Yes,, you are right arlu1201,,,,,,,
    My mistake,,,,
    I allied the filter before I ran the original code that I posted!!!

    It was working after all,,,

    I was just wrong in how I applied it! :-(

    Many thanks for pointing this out.

    I'll never be a coder (I can format ok though) :-)

    All the best
    TheGhost,
    And thanks again ....It was bugging me !!

  6. #6
    Forum Contributor
    Join Date
    02-19-2007
    Location
    Poole England
    MS-Off Ver
    2010
    Posts
    117

    Re: Remove A Filter Arrow?

    Hi SHG!!

    Many thanks for your reply,,,

    Great stuff.
    I made a schoolboy error it seems :-(

    I've just seen your code that you've posted....
    Surely yours is better,, I mean more efficient?
    It uses a lot less lines of code.

    I think I'll convert to your suggestion SHG.
    Many thanks for this.

    Just to add,, if I wanted to TWEAK your code,, I mean say I want to remove 2 filters,, say F4 & H4???
    I just tried;
    Please Login or Register  to view this content.
    This removed F4,, but not H4 filter :-(

    Can you just advise me on this 1 SHG,, as then I can alter filters on my sheets at will real easy

    I just thought I could add 1 more cell reference into your code,, (IE h4)
    Seems I done it wrong

    Many thanks for your reply though.

    My sheet is really starting to look special.
    All the best
    A very Grateful
    TheGhost

  7. #7
    Forum Contributor
    Join Date
    02-19-2007
    Location
    Poole England
    MS-Off Ver
    2010
    Posts
    117

    Re: Remove A Filter Arrow?

    Hi SHG,,,
    I managed to get your code working by adding .. repeating 2 lines of your code..
    it now looks like;
    Please Login or Register  to view this content.
    it worked !! (Which is highly unusual for me.. :-)

    Is the code ok though?
    I mean,, is this the correct way it should be?
    Just because I winged it,, and got it to work doesn't make it correct.

    but still,, it was nice for once to get it working..;-)

    If you can advise if this is OK I'd be most grateful,

    many Thanks
    TheGhost

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Remove A Filter Arrow?

    Looks good to me, John.

  9. #9
    Forum Contributor
    Join Date
    02-19-2007
    Location
    Poole England
    MS-Off Ver
    2010
    Posts
    117

    Re: Remove A Filter Arrow?

    Excellent!!
    many thanks again..
    It's to go in my 2nd FREE PRO spreadsheet I'm working on...
    Top secret,, well,, not so secret now,, hehe:-0
    I'll credit you again for this SHG! ;-)

    All the best
    TheGhost

+ 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