+ Reply to Thread
Results 1 to 3 of 3

VBA command to show all data - Autofilters

Hybrid View

  1. #1
    Registered User
    Join Date
    11-23-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    38

    Question VBA command to show all data - Autofilters

    Hi all: I can't seem to recall the VBA syntax to show all data in a worksheet, which has AUTOFILTER set.

    In my VBA code, I have a total of 4 worksheets that is used. How would I be able to show all data in worksheet 2 per se? Please note, I do not want to remove the AutoFilter - just need to remove any filters applied to whatever columns.

    I read I can use:

    ActiveSheet.ShowAllData

    But in this case, what is the syntax to replace "ActiveSheet" with the appropriate worksheet (Ie. Sheet2)

    Thanks for helping a VBA newbie

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA command to show all data - Autofilters

    Hi, you can reference a worksheet using
    Sheets("Sheet2")
    Where sheet2 is the tab name
    or
    Sheets(2)
    Where 2 is the index, or position of the sheet in the worksheet
    or
    Sheet2
    Where Sheet2 is the name of the vba object of the worksheet (in the project tree)

    So using the first method:
    Macro_show_data()
    Sheets("Sheet2").ShowAllData
    End Sub

  3. #3
    Registered User
    Join Date
    11-23-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: VBA command to show all data - Autofilters

    Ragukluy: Ah geez....it's that easy. THANKS SO MUCH! Works like a charm. Feel a bit embarrassed..something so simple can cost so much time.

    Thanks again,
    Melissa

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Any vba command for show all and unhide
    By macrofan2012 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-23-2012, 05:08 AM
  2. Show worksheet from Command Button?
    By themikeford in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2012, 10:32 PM
  3. Show and hide rows on command
    By NMarien in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-14-2011, 10:56 AM
  4. [SOLVED] command to show top of worksheet?
    By davegb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2005, 12:05 PM
  5. [SOLVED] On my data menu, my list command does not show
    By pebbles2005 in forum Excel General
    Replies: 1
    Last Post: 03-28-2005, 06:06 PM

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