+ Reply to Thread
Results 1 to 4 of 4

Using a macro to show all data in a spreadsheet

  1. #1
    Registered User
    Join Date
    07-08-2019
    Location
    United States
    MS-Off Ver
    2019
    Posts
    29

    Question Using a macro to show all data in a spreadsheet

    Hello!! Question for you all.

    I have a spreadsheet full of data that is sorted by columns/filters. I have a button that clears all filters and shows all the data without any filter. The code behind the button is:

    Please Login or Register  to view this content.
    This button works. However, if I am already showing all of the data, aka already ran the button, and I hit the button again I get an error:

    Run-Time error '1004': ShowAllData of Worksheet class failed.

    How do I manipulate the code so that when I hit the button multiple times I don't get this error but instead the same code is run again? Thanks!
    Last edited by jeffreybrown; 02-27-2020 at 12:21 PM. Reason: Please use code tags!

  2. #2
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Using a macro to show all data in a spreadsheet

    you have to check, if data are filtered. If not then you will get the error
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-08-2019
    Location
    United States
    MS-Off Ver
    2019
    Posts
    29

    Re: Using a macro to show all data in a spreadsheet

    gue2013, Thank you!! This is the code that worked for me:

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 02-27-2020 at 12:21 PM. Reason: Please use code tags!

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Using a macro to show all data in a spreadsheet

    Hello Byebye14,

    Please use code tags when posting code! Thanks
    HTH
    Regards, Jeff

+ 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. Edit Macro to send data to a Named spreadsheet instead of a new spreadsheet?
    By frankcase in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-27-2019, 05:36 PM
  2. Macro to filter Data Shows details but data disappears or does not show all
    By AmandaM73 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2019, 12:20 AM
  3. Replies: 3
    Last Post: 04-07-2014, 07:43 PM
  4. Replies: 3
    Last Post: 03-16-2014, 02:33 PM
  5. Macro to Export Data from one spreadsheet to a Report Spreadsheet
    By stockgoblin42 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-11-2013, 03:59 PM
  6. Show all data in spreadsheet via listview (VBA)
    By martinl4 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-11-2011, 10:33 AM
  7. Replies: 4
    Last Post: 11-25-2009, 08:10 PM

Tags for this Thread

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