HI, If you want to put formula by vba please try this Sub fillformula() Dim lngLastRow As Long Dim lngLastCol As Long lngLastRow = Sheet2.UsedRange.Rows.Count lngLastCol = Sheet2.UsedRange.Columns.Count Sheet2.Range("d3").Formula = "=iferror(if(" & Range("c3").Address(0, 1) & "=" & """Count""" & ",sumifs('Audit details'!" & Range("l3:l54").Address & ",'Audit details'!" & Range("h3:h54").Address & "," & Range("b3").Address(0, 1) & ",'Audit details'!" & Range("b3:b54").Address & "," & Range("d2").Address(1, 0) & ")+" & "sumifs('Audit details'!" & Range("l3:l54").Address & ",'Audit details'!" & Range("i3:i54").Address & "," & Range("b3").Address(0, 1) & ",'Audit details'!" & Range("b3:b54").Address & "," & Range("d2").Address(1, 0) & ")+" & "sumifs('Audit details'!" & Range("l3:l54").Address & ",'Audit details'!" & Range("j3:j54").Address & "," & Range("b3").Address(0, 1) & ",'Audit details'!" & Range("b3:b54").Address & "," & Range("d2").Address(1, 0) & ")" & "," & """""" & ")," & """""" & ")" Sheet2.Range("d3").Resize(lngLastRow, lngLastCol).FillDown Sheet2.Range("d3").Resize(lngLastRow, lngLastCol).FillRight End Sub
On Wed, Mar 19, 2014 at 11:21 AM, Prabhu Pinky <prabhupin...@gmail.com>wrote: > any experts here..??? > > Please help with my query. its very urgent. > > > > Thanks & Regards, > Prabhu R > > > ---------- Forwarded message ---------- > From: Prabhu Pinky <prabhupin...@gmail.com> > Date: 19 March 2014 10:41 > Subject: $$Excel-Macros$$ Need VBA code for Sumifs function. > To: "excel-macros@googlegroups.com" <excel-macros@googlegroups.com> > > > Hi experts, > > Please find the attached file. i almost complete my project. But struck up > in sumifs part. > > i used formula in sheet2. but i need to have it in VBA code. i tried it > but the cell reference is not changing. whatever the result i get for AAA, > same value i get for other agents. > > most importantly i need only values should past here in sheet. due to > file size problem. > > if formulas are pasted here then i am unable to open the file. it takes > too long. > > > > Thanks & Regards, > Prabhu R > > -- > Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It's > =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > 2) Don't post a question in the thread of another member. > 3) Don't post questions regarding breaking or bypassing any security > measure. > 4) Acknowledge the responses you receive, good or bad. > 5) Jobs posting is not allowed. > 6) Sharing copyrighted material and their links is not allowed. > > NOTE : Don't ever post confidential data in a workbook. Forum owners and > members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to excel-macros+unsubscr...@googlegroups.com. > To post to this group, send email to excel-macros@googlegroups.com. > Visit this group at http://groups.google.com/group/excel-macros. > For more options, visit https://groups.google.com/d/optout. > > -- > Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It's > =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ > https://www.facebook.com/discussexcel > > FORUM RULES > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > 2) Don't post a question in the thread of another member. > 3) Don't post questions regarding breaking or bypassing any security > measure. > 4) Acknowledge the responses you receive, good or bad. > 5) Jobs posting is not allowed. > 6) Sharing copyrighted material and their links is not allowed. > > NOTE : Don't ever post confidential data in a workbook. Forum owners and > members are not responsible for any loss. > --- > You received this message because you are subscribed to the Google Groups > "MS EXCEL AND VBA MACROS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to excel-macros+unsubscr...@googlegroups.com. > To post to this group, send email to excel-macros@googlegroups.com. > Visit this group at http://groups.google.com/group/excel-macros. > For more options, visit https://groups.google.com/d/optout. > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It's =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.