Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Runtime Error 1004
I have a user form with the following code and while the code is running I received a RunTime Error 1004 - Method 'select' of object'_worksheet failed. My code is set up to bring up a user form where I type a name and press Get Data. The code should run through each worksheets and autofilter the name that I typed in the user form. The code apears to work - actually filters the last sheet and then the Runtime Error pops up. Private Sub cmdFilter_Click() Dim sh As Worksheet For Each sh In ActiveWorkbook.Worksheets sh.Select Range("A2").Select Selection.AutoFilter Selection.AutoFilter Field:=1, Criteria1:=tbName Next sh Unload Me Sheet1.Select End Sub Any help is appreciated. :( -- Lizz45ie ------------------------------------------------------------------------ Lizz45ie's Profile: http://www.excelforum.com/member.php...o&userid=23410 View this thread: http://www.excelforum.com/showthread...hreadid=483313 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
runtime error 1004 | Excel Discussion (Misc queries) | |||
Runtime error 1004 | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
What is RunTime Error '1004'? | Excel Programming | |||
runtime error 1004 | Excel Programming |