View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default VBA - Worksheet Subtraction

Tony

Somevalue=Range("B2").Value-Range("B1").Value

This presumes the sheet is active (Else you'll need to define the worksheet
before the Range object), you can then read Somevalue variable

There are other ways to do this like writing a user defined function, but
not knowing what you are trying to do with the value the above should give
you a start

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"ajocius" wrote in
message ...

Group,
On a worksheet I can subtract in cell =B2 - B1 in cell B3. How
would I do the same operation in VBA?

Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile:
http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=488576