![]() |
#1
|
|||
|
|||
![]()
How to create an error debug message if need. All help appreciated. Thanks
Sub Test2() ' ' Test2 Macro ' ' Sheets("Query").Select Range("Table_Query_from_MS_Access_Database[[#Headers],[IsMail]]").Select Selection.AutoFilter ActiveSheet.ListObjects("Table_Query_from_MS_Acces s_Database").Range. _ AutoFilter Field:=4, Criteria1:="=Yes", Operator:=xlOr, Criteria2:="=" Cells.Select Selection.Copy Sheets("Result").Select Range("A1").Select ActiveSheet.Paste Sheets("Query").Select Range("E6").Select Application.CutCopyMode = False Selection.AutoFilter Sheets("Score_Analysis").Select Columns("A:F").Select Selection.Copy Sheets("Test").Select Range("A1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Sheets("Score_Analysis").Select Application.CutCopyMode = False Columns("C:F").Select ActiveWorkbook.Worksheets("Score_Analysis").ListOb jects("Score_Table").Sort. _ SortFields.Add Key:=Range("Score_Table[[#Headers],[Nature/ " & Chr(10) & "Mail]]"), _ SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal Range("C500:F500").Select Selection.AutoFill Destination:=Range("C2:F500"), Type:=xlFillDefault Cells.Select Cells.EntireRow.AutoFit Range("A1").Select End Sub |
#2
|
|||
|
|||
![]()
Hi
What you mean by "an error debug message " In case of an error, excel will create the appropiate message itself. But probably you don't want that message, but rather one you create yourself. That's called error handling, and can become quite tricky. Usually you should write the code the way to avoid errors taking in consideration which errors possibly might come up during runtime. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jdc15371 | Outlook | 1 | 06-23-2014 06:25 AM |
![]() |
hlina | Excel | 1 | 10-08-2013 09:14 PM |
![]() |
JoyConner | Outlook | 1 | 04-21-2011 05:44 PM |
Error message | White House | Outlook | 1 | 12-07-2010 04:52 AM |
Microsoft Office 2003 winword.exe Debug Error! abnormal prog | elo1bev | Word | 0 | 12-22-2005 10:15 AM |