Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Function or macro help

Find the sum of values in column D that equals the value
in A1
D
A1 10
600 100
500
50
200
Is there a function that does this and can it tell me
which cells in Column D were used to find the Value in A1

Also if multiple if source values are used.

Complicated I know but no other way of explaining.
Currently using a macro to find if cell and cell.offset
(1,0)=A1 etc


Send the answer to as well as
here.

Probably no result, that's okay.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default Function or macro help

"Mark" skrev i melding
...
Find the sum of values in column D that equals the value
in A1
D
A1 10
600 100
500
50
200


=SUMIF(D1:D1000,A1)
this used in VBA:
MsgBox Application.WorksheetFunction.SumIf(Range(Cells(1, 4), Cells(1000,
4)), Cells(1, 1))

Is there a function that does this and can it tell me
which cells in Column D were used to find the Value in A1


I'd use a loop for that:

Private Sub CommandButton1_Click()
Dim R As Range, Cel As Range
Dim S As String
Set R = Range(Cells(1, 4), Cells(1000, 4))
For Each Cel In R
If Cel.Value = Cells(1, 1).Value Then _
S = S & Cel.Address(0, 0, xlA1) & ", "
Next
MsgBox S
End Sub

HTH. Best wishes Harald


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Function or macro help


Thanks Harald for the reply. I did not phrase it too well and we, who
reply to others, always complain of obtuse or lack of information of
requesters.

Like they say, a doctor is the worst patient.

Anyway, i will try out your reply on the data.

Thanks again
mark


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Using macro or other function orquidea Excel Discussion (Misc queries) 2 December 5th 07 05:37 PM
Is there a Function or Macro for This? Marilyn Excel Discussion (Misc queries) 6 November 6th 07 03:21 AM
Sub Macro vrs Function Macro Auto Start Pat Excel Discussion (Misc queries) 7 June 6th 07 09:53 PM
Macro Function thuva Excel Worksheet Functions 1 July 26th 06 08:02 AM
Macro or function MIchel Khennafi Excel Worksheet Functions 2 May 15th 06 09:16 PM


All times are GMT +1. The time now is 10:25 AM.

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"