Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
how can I trap an overflow error for a division made in vba code? Example: .. other coding .. If IsError(.Cells(1, 1).Offset(0, -2).Value / .Cells(BaseRangeRow, 1).Offset(0, -2).Value) Then .Cells(1, 1).Value = CVErr(xlErrNA) Else .Cells(1, 1).Value = .Cells(1, 1).Offset(0, -2).Value / .Cells(BaseRangeRow, 1).Offset(0, -2).Value End If .. other coding .. When the denomonator is 0, then the procedure stops with an eeror message "Overflow" Any idea to manage this situation? Excel XP SP3 WIN XP SP1 Regards Werner |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 4 Apr, 16:14, Werner Rohrmoser wrote:
Hello, how can I trap an overflow error for a division made in vba code? Example: . other coding . If IsError(.Cells(1, 1).Offset(0, -2).Value / .Cells(BaseRangeRow, 1).Offset(0, -2).Value) Then * *.Cells(1, 1).Value = CVErr(xlErrNA) Else * *.Cells(1, 1).Value = .Cells(1, 1).Offset(0, -2).Value / .Cells(BaseRangeRow, 1).Offset(0, -2).Value End If . other coding . When the denomonator is 0, then the procedure stops with an eeror message "Overflow" Any idea to manage this situation? Excel XP SP3 WIN XP SP1 Regards Werner Hi Werner If "denominator" = 0 Then 'Do nothing Else Run code End if Regards Steve |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Scoops,
simple and good. Werner |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use On Error
-- Gary''s Student - gsnu2007g "Werner Rohrmoser" wrote: Hello, how can I trap an overflow error for a division made in vba code? Example: .. other coding .. If IsError(.Cells(1, 1).Offset(0, -2).Value / .Cells(BaseRangeRow, 1).Offset(0, -2).Value) Then .Cells(1, 1).Value = CVErr(xlErrNA) Else .Cells(1, 1).Value = .Cells(1, 1).Offset(0, -2).Value / .Cells(BaseRangeRow, 1).Offset(0, -2).Value End If .. other coding .. When the denomonator is 0, then the procedure stops with an eeror message "Overflow" Any idea to manage this situation? Excel XP SP3 WIN XP SP1 Regards Werner |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Gary,
yes, works as well. Werner |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Overflow | Excel Programming | |||
Overflow | Excel Programming | |||
can't trap overflow error! | Excel Programming | |||
VBA overflow | Excel Programming | |||
VBA overflow | Excel Programming |