Thread
:
finding two cells to sum
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
finding two cells to sum
If your cell is really named sales then this formula will do it.
=D7+OFFSET(sales,0,-5)
by macro
Sub salesplus()
Range("b7") = Range("d7") + Range("sales")
End Sub
If you are looking for "sales" as text use this
If sales is always in col D use
columns(4).find
instead for better efficiency.
Sub findSALES()
Range("b4") = Range("d7") _
+ Cells.Find("sales").Offset(0, -5)
End Sub
--
Don Guillett
SalesAid Software
"Hru48" wrote in
message ...
Hey,
I need a statement to put in a macro that will find two cells and sum
them putting the result in cell d4. The first cell is always d7 but the
second cell moves about every time the data is updated.
I'm at a bit of a loss as to how to find the second cell, it is always
3 to the left of a cell named sales so I thought I may be search for
the cell 'sales' and then use then use offset to get the cell 3 to the
left and then define a name for it so I could use it in the sum... but
this doesn't work as it gives the cell a reference rather then calling
it active.cell.
Can anyone this of a way of doing this? As I am a wee bit stumped.
Cheers
Hayley
--
Hru48
------------------------------------------------------------------------
Hru48's Profile:
http://www.excelforum.com/member.php...o&userid=24895
View this thread:
http://www.excelforum.com/showthread...hreadid=542085
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett