Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default #DIV/0! error using VB

I populated an entire column using

ActiveCell.FormulaR1C1 = "=(RC[-5]/RC[-1])*52"

and some of the results equate to #DIV/0! based on RC[-1].

I want to read each cell for a variable amount of rows in
a single column, and if the value of RC[-1] is zero, force
the current cell to zero. This would eliminate the divide
by zero from displaying. The above activecell statement
calculates the entire column with 1 statement instead of
looping.

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default #DIV/0! error using VB

ActiveCell.FormulaR1C1 = "=if(RC[-1]=0,0,(RC[-5]/RC[-1])*52)"

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Bruce Brosek" wrote in message
...
I populated an entire column using

ActiveCell.FormulaR1C1 = "=(RC[-5]/RC[-1])*52"

and some of the results equate to #DIV/0! based on RC[-1].

I want to read each cell for a variable amount of rows in
a single column, and if the value of RC[-1] is zero, force
the current cell to zero. This would eliminate the divide
by zero from displaying. The above activecell statement
calculates the entire column with 1 statement instead of
looping.

Thanks,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default #DIV/0! error using VB

Worked perfect, thank you very much!

Bruce

-----Original Message-----
ActiveCell.FormulaR1C1 = "=if(RC[-1]=0,0,(RC[-5]/RC[-1])

*52)"

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Bruce Brosek" wrote in

message
...
I populated an entire column using

ActiveCell.FormulaR1C1 = "=(RC[-5]/RC[-1])*52"

and some of the results equate to #DIV/0! based on RC[-

1].

I want to read each cell for a variable amount of rows

in
a single column, and if the value of RC[-1] is zero,

force
the current cell to zero. This would eliminate the

divide
by zero from displaying. The above activecell statement
calculates the entire column with 1 statement instead of
looping.

Thanks,



.

Reply
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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
I have Error 1919 Error Configuring ODBC dataSource Database Texanna1 Excel Discussion (Misc queries) 1 September 12th 06 06:35 AM


All times are GMT +1. The time now is 05:14 AM.

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

About Us

"It's about Microsoft Excel"