![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 10
|
I have an excel database that is contained within a single worksheet that utilized the autofilter as sort of a query tool. Instead of having to manually go to the data window or each drop-down list to show all, I would like to make a button that, once pressed, would show all and refresh the database back to its original data. I tried using the record feature, but I get an error in the active sheet line of code. I don't know much visual basic, so is there code for this type of thing? Thank you in advance!
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Greenwood, SC
Posts: 677
|
I've not done much with autofilters in code other than create them, so I'm not much help. On the other hand, in excel's help files, search for AutoFilterMode and check out some of the code examples (especially the Autofilter, Filter and Filters Collection objects). They may get you on the right track.
In any event, this reply gets your questions back to the top of the board... K |
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Posts: 37
|
I think that the visual basic line below would do the trick
Sheets("sheet name").ShowAlldata End Sub "Sheet name" being the name of your worksheet |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Helena, MT
Posts: 13,690
|
Ther is already a custom button in Excel that does this. Right Click on any tool bar and choose Customize. On the Commands tab, choose Data and locate the Show All button. Drag it to any toolbar. Click Close.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|