LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default VBA CODE to Subtract two cells

Does this not suit your needs? If not, can you explain what you need
differently here? Will this be dependent on some rows? Any headers? Only
to a certain row?

--
Regards,
Zack Barresse, aka firefytr

"Kevin Baker" wrote in message
news:P4dee.669$It1.624@lakeread02...
Here is what I have:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 6 And Target.Value 1 And Target.Offset(0, 2).Value
1
Then
Target.Offset(0, 3).Value = Target.Value - Target.Offset(0, 2).Value
End If
End Sub



"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










 
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
How can I subtract cells in two different worksheets? Carl M Excel Discussion (Misc queries) 3 April 3rd 23 04:34 PM
Subtract and multiply as a code ???????? Tdp Excel Discussion (Misc queries) 6 November 10th 08 03:35 PM
How do I make cells subtract? Robert[_3_] Excel Worksheet Functions 3 July 18th 07 11:40 PM
How can I subtract cells in a row wildfyre New Users to Excel 3 February 14th 06 07:26 PM
how to add or subtract from two cells into one labjr1231 Excel Worksheet Functions 2 September 6th 05 06:40 AM


All times are GMT +1. The time now is 01:19 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"