LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Divide Expression stops in Macro when Can't divide

Hello,
have following sample code:

Dim i as long

For i = 1 To ActiveSheet.UsedRange.Rows.Count
If Cells(i, "A") = "SEM Total" Then
Cells(i, "D").Value = Cells(i, "C") / Cells(i, "B")
Cells(i, "G").Value = Cells(i, "F") / Cells(i, "E")
Works fine but if it cannot divide, the macro stops.
Example,
I could have in Col C 0 and Cold B 0, so this can't be
divided. 0/0 OR 1/0. Is there a way round this?
Please advise any info. would appreciate it alot.
Thanks
Juan
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
divide by zero Meebers[_2_] Excel Worksheet Functions 6 January 27th 09 10:05 PM
Divide By help? kirstie adam Excel Worksheet Functions 2 December 5th 06 04:23 PM
Divide by 3 GARY Excel Discussion (Misc queries) 1 May 11th 06 03:26 PM
Divide one row over other row I dont wont to divide one number Rick Excel Discussion (Misc queries) 0 March 4th 05 07:13 PM
Divide By 0 Mike Short Excel Programming 4 November 30th 03 06:13 AM


All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"