View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default VBA CODE to Subtract two cells

use this to put the value in all.VERY fast & no formula left

sub doformulas
set mr=range("i2:i"&cells(rows.count,"i").end(xlup).ro w)
with mr
..formula="=f2-g2"
..formula=.value
end with
end sub

--
Don Guillett
SalesAid Software

"Kevin Baker" wrote in message
news:vWcee.667$It1.55@lakeread02...
Hi all.

It seems when I use a formula (the formula would need to be in the entire
column of "I") the spreadsheet file size is very large, however, it seems
when I use VBA code the file size doesn't grow as much.

In my spreadsheet column "I" would be the difference between the value in
Column "F" and Column "G".

Does that make sense?

Thanks for all your help,
Kevin
"zackb" wrote in message
...
Hi,

Depending on where you want it to go, I'm making some assumptions here

....

Range("A1").Value = Range("F2").value - Range("H2").value

or

Range("A1").formula = "=F2-H2"

--
Regards,
Zack Barresse, aka firefytr

"Kevin Baker" wrote in message
news:UPbee.660$It1.521@lakeread02...
Would like to use VB Code to do the following:

=F2-H2

Thanks,
Kevin