PC Review


Reply
Thread Tools Rate Thread

combining rows

 
 
vern
Guest
Posts: n/a
 
      18th Nov 2009
I am loking for a macro that I can put in a command button that will look
through a work sheet in column "A" for identical numerical values. once found
take all rows with identical values and combine the rows into one in a
different worksheet. when combined it must add together the different values
of the rows in columns "f", "g" "h", "i" and "j".

can this be done?
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      18th Nov 2009
Could using SUMIF do it?

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"vern" <(E-Mail Removed)> wrote in message
news:CB5193A5-33AA-40F0-BE3D-(E-Mail Removed)...
>I am loking for a macro that I can put in a command button that will look
> through a work sheet in column "A" for identical numerical values. once
> found
> take all rows with identical values and combine the rows into one in a
> different worksheet. when combined it must add together the different
> values
> of the rows in columns "f", "g" "h", "i" and "j".
>
> can this be done?


 
Reply With Quote
 
vern
Guest
Posts: n/a
 
      18th Nov 2009
Thank you Don, I just sent you the information.

Vern

"Don Guillett" wrote:

> Could using SUMIF do it?
>
> If desired, send your file to my address below. I will only look if:
> 1. You send a copy of this message on an inserted sheet
> 2. You give me the newsgroup and the subject line
> 3. You send a clear explanation of what you want
> 4. You send before/after examples and expected results.
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "vern" <(E-Mail Removed)> wrote in message
> news:CB5193A5-33AA-40F0-BE3D-(E-Mail Removed)...
> >I am loking for a macro that I can put in a command button that will look
> > through a work sheet in column "A" for identical numerical values. once
> > found
> > take all rows with identical values and combine the rows into one in a
> > different worksheet. when combined it must add together the different
> > values
> > of the rows in columns "f", "g" "h", "i" and "j".
> >
> > can this be done?

>
> .
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      18th Nov 2009
=IF(A12="","",VLOOKUP(A12,ESTIMATE!$A$9:$B$15,2,0))
and
=IF($A12="","",SUMIF(ESTIMATE!$A$9:$A$15,$A12,ESTIMATE!K$9:K$15))
copied across and down or a macro

Sub UpdateFromEstimteSAS()
Set ds = Sheets("Budget")
With Sheets("Estimate")
Lr = .Cells(Rows.Count, 1).End(xlUp).Row
With .Range("a8:a" & Lr)
..AdvancedFilter Action:=xlFilterInPlace, Unique:=True
..Copy ds.Range("a17")
..AutoFilter
..AutoFilter
End With
dlr = ds.Cells(Rows.Count, 1).End(xlUp).Row
ds.Range("b19:b" & dlr).Formula = _
"=IF($A19="""","""",VLOOKUP($A19,ESTIMATE!$A$9:$B$15,2,0))"
ds.Range("c19:h" & dlr).Formula = _
"=IF($a19="""","""",SUMIF(ESTIMATE!$A$9:$A$15,$A19,ESTIMATE!K$9:K$15))"
ds.Range("b19:h" & dlr).Value = ds.Range("b19:h" & dlr).Value
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"vern" <(E-Mail Removed)> wrote in message
news:332B1CDF-940B-498C-9106-(E-Mail Removed)...
> Thank you Don, I just sent you the information.
>
> Vern
>
> "Don Guillett" wrote:
>
>> Could using SUMIF do it?
>>
>> If desired, send your file to my address below. I will only look
>> if:
>> 1. You send a copy of this message on an inserted sheet
>> 2. You give me the newsgroup and the subject line
>> 3. You send a clear explanation of what you want
>> 4. You send before/after examples and expected results.
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>> (E-Mail Removed)
>> "vern" <(E-Mail Removed)> wrote in message
>> news:CB5193A5-33AA-40F0-BE3D-(E-Mail Removed)...
>> >I am loking for a macro that I can put in a command button that will
>> >look
>> > through a work sheet in column "A" for identical numerical values. once
>> > found
>> > take all rows with identical values and combine the rows into one in a
>> > different worksheet. when combined it must add together the different
>> > values
>> > of the rows in columns "f", "g" "h", "i" and "j".
>> >
>> > can this be done?

>>
>> .
>>


 
Reply With Quote
 
vern
Guest
Posts: n/a
 
      19th Nov 2009
What I sent over was just a small portion, is there a way to have this look
at the entire sheet? there could possibly be up to 500 rows, not just a8 - a19

thank you

"Don Guillett" wrote:

> =IF(A12="","",VLOOKUP(A12,ESTIMATE!$A$9:$B$15,2,0))
> and
> =IF($A12="","",SUMIF(ESTIMATE!$A$9:$A$15,$A12,ESTIMATE!K$9:K$15))
> copied across and down or a macro
>
> Sub UpdateFromEstimteSAS()
> Set ds = Sheets("Budget")
> With Sheets("Estimate")
> Lr = .Cells(Rows.Count, 1).End(xlUp).Row
> With .Range("a8:a" & Lr)
> ..AdvancedFilter Action:=xlFilterInPlace, Unique:=True
> ..Copy ds.Range("a17")
> ..AutoFilter
> ..AutoFilter
> End With
> dlr = ds.Cells(Rows.Count, 1).End(xlUp).Row
> ds.Range("b19:b" & dlr).Formula = _
> "=IF($A19="""","""",VLOOKUP($A19,ESTIMATE!$A$9:$B$15,2,0))"
> ds.Range("c19:h" & dlr).Formula = _
> "=IF($a19="""","""",SUMIF(ESTIMATE!$A$9:$A$15,$A19,ESTIMATE!K$9:K$15))"
> ds.Range("b19:h" & dlr).Value = ds.Range("b19:h" & dlr).Value
> End With
> End Sub
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "vern" <(E-Mail Removed)> wrote in message
> news:332B1CDF-940B-498C-9106-(E-Mail Removed)...
> > Thank you Don, I just sent you the information.
> >
> > Vern
> >
> > "Don Guillett" wrote:
> >
> >> Could using SUMIF do it?
> >>
> >> If desired, send your file to my address below. I will only look
> >> if:
> >> 1. You send a copy of this message on an inserted sheet
> >> 2. You give me the newsgroup and the subject line
> >> 3. You send a clear explanation of what you want
> >> 4. You send before/after examples and expected results.
> >> --
> >> Don Guillett
> >> Microsoft MVP Excel
> >> SalesAid Software
> >> (E-Mail Removed)
> >> "vern" <(E-Mail Removed)> wrote in message
> >> news:CB5193A5-33AA-40F0-BE3D-(E-Mail Removed)...
> >> >I am loking for a macro that I can put in a command button that will
> >> >look
> >> > through a work sheet in column "A" for identical numerical values. once
> >> > found
> >> > take all rows with identical values and combine the rows into one in a
> >> > different worksheet. when combined it must add together the different
> >> > values
> >> > of the rows in columns "f", "g" "h", "i" and "j".
> >> >
> >> > can this be done?
> >>
> >> .
> >>

>
> .
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      19th Nov 2009
Send your file to my address below

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"vern" <(E-Mail Removed)> wrote in message
news:65094DCD-9C44-4937-A372-(E-Mail Removed)...
> What I sent over was just a small portion, is there a way to have this
> look
> at the entire sheet? there could possibly be up to 500 rows, not just a8 -
> a19
>
> thank you
>
> "Don Guillett" wrote:
>
>> =IF(A12="","",VLOOKUP(A12,ESTIMATE!$A$9:$B$15,2,0))
>> and
>> =IF($A12="","",SUMIF(ESTIMATE!$A$9:$A$15,$A12,ESTIMATE!K$9:K$15))
>> copied across and down or a macro
>>
>> Sub UpdateFromEstimteSAS()
>> Set ds = Sheets("Budget")
>> With Sheets("Estimate")
>> Lr = .Cells(Rows.Count, 1).End(xlUp).Row
>> With .Range("a8:a" & Lr)
>> ..AdvancedFilter Action:=xlFilterInPlace, Unique:=True
>> ..Copy ds.Range("a17")
>> ..AutoFilter
>> ..AutoFilter
>> End With
>> dlr = ds.Cells(Rows.Count, 1).End(xlUp).Row
>> ds.Range("b19:b" & dlr).Formula = _
>> "=IF($A19="""","""",VLOOKUP($A19,ESTIMATE!$A$9:$B$15,2,0))"
>> ds.Range("c19:h" & dlr).Formula = _
>> "=IF($a19="""","""",SUMIF(ESTIMATE!$A$9:$A$15,$A19,ESTIMATE!K$9:K$15))"
>> ds.Range("b19:h" & dlr).Value = ds.Range("b19:h" & dlr).Value
>> End With
>> End Sub
>>
>> --
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>> (E-Mail Removed)
>> "vern" <(E-Mail Removed)> wrote in message
>> news:332B1CDF-940B-498C-9106-(E-Mail Removed)...
>> > Thank you Don, I just sent you the information.
>> >
>> > Vern
>> >
>> > "Don Guillett" wrote:
>> >
>> >> Could using SUMIF do it?
>> >>
>> >> If desired, send your file to my address below. I will only look
>> >> if:
>> >> 1. You send a copy of this message on an inserted sheet
>> >> 2. You give me the newsgroup and the subject line
>> >> 3. You send a clear explanation of what you want
>> >> 4. You send before/after examples and expected results.
>> >> --
>> >> Don Guillett
>> >> Microsoft MVP Excel
>> >> SalesAid Software
>> >> (E-Mail Removed)
>> >> "vern" <(E-Mail Removed)> wrote in message
>> >> news:CB5193A5-33AA-40F0-BE3D-(E-Mail Removed)...
>> >> >I am loking for a macro that I can put in a command button that will
>> >> >look
>> >> > through a work sheet in column "A" for identical numerical values.
>> >> > once
>> >> > found
>> >> > take all rows with identical values and combine the rows into one in
>> >> > a
>> >> > different worksheet. when combined it must add together the
>> >> > different
>> >> > values
>> >> > of the rows in columns "f", "g" "h", "i" and "j".
>> >> >
>> >> > can this be done?
>> >>
>> >> .
>> >>

>>
>> .
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining rows LOST Microsoft Excel Misc 4 29th Oct 2008 05:41 PM
Combining Rows =?Utf-8?B?Smlt?= Microsoft Excel Worksheet Functions 7 9th Mar 2007 10:27 PM
combining rows =?Utf-8?B?U2FzaA==?= Microsoft Access Queries 1 10th Apr 2005 04:27 PM
Combining Rows =?Utf-8?B?VG9tZTcz?= Microsoft Dot NET 3 7th Dec 2004 07:44 PM
Combining rows Brenda Microsoft Excel Worksheet Functions 4 23rd Oct 2003 05:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:39 PM.