Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not true; there is a difference when it comes to error handling. If you
omit the "WorksheetFunction", you can trap the error in a Variant and test that with IsError. If you include "WorksheetFunction", you must trap a run-time error with an On Error statement. Sub AAA() Dim V As Variant V = Application.Sum(Range("A1:A3")) If IsError(V) = True Then Debug.Print "ERROR USING SUM" Else Debug.Print CStr(V) End If On Error Resume Next Err.Clear V = Application.WorksheetFunction.Sum(Range("A1:A3")) If Err.Number < 0 Then Debug.Print "ERROR USING SUM" Else Debug.Print CStr(V) End If End Sub Thanks Chip. BTW, the newsletters are very educational. -pb |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search for a column based on the column header and then past data from it to another column in another workbook | Excel Programming | |||
Macro to paste data to a new column if previous column has data | Excel Programming | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Programming | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Discussion (Misc queries) | |||
Matching one column against another column of data to show the same amount of data. | Excel Worksheet Functions |