Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I can run the following code from the command button but get
"Runtime error "1004" Application-defined or object-defined error" when I try to step thru it in VBA at Range("J2").Select Private Sub CommandButton1_Click() 'Print or view birthday list Application.ScreenUpdating = False Application.DisplayAlerts = False ' Dim Birthdate As String Birthdate = Range("Form!M15") Sheets("Records").Select Range("J2").Select Selection.AutoFilter Selection.AutoFilter Field:=10, Criteria1:=Birthdate, Operator:=xlAnd Selection.Sort Key1:=Range("J3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Range("B2:L2").Select ' Selects all filtered data Range(Selection, Selection.End(xlDown)).Select Selection.Copy 'Copies filtered job data Sheets("Birthday").Select Range("A2").Select ActiveSheet.Paste 'Pastes Values Range("A1:K2").Select ' Selects all filtered data Range(Selection, Selection.End(xlDown)).Select 'Selection.Copy 'Copies filtered job Selection.PrintOut Copies:=1, Preview:=True, Collate:=True Range("A2:K2").Select ' Selects all filtered data Range(Selection, Selection.End(xlDown)).Select Selection.Clear Sheets("Records").Select Selection.AutoFilter Sheets("Form").Select ' Goes to date input screen Range("A47").Select Range("C47").Select End SubI have the following code |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error 1004 HELP PLS | Excel Discussion (Misc queries) | |||
runtime error '1004' | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
runtime error 1004 | Excel Programming | |||
runtime error 1004 | Excel Programming |