Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for multiple columns and rows
I would like to know if the following code can be reduced:
In the code below the value for €˜processed Amount!B1 is the date 1/1/2006. I currently copy the four lines of code and change cells B1 and B2 to the next columns C1 and C2€¦ M1 and M2. This gives me the data I need for all 12 months. Dim jan As String, feb As String, mar As String, apr As String, may As String, jun As String, jul As String, aug As String, sep As String, oct As String, nov As String, dec As String Dim v As Variant €˜Total CSO Reimbursements Processed jan = "=SumProduct(--(Sheet4!A1:A30000=" & _ "'processed Amount'!B1),--(Sheet4!AL1:AL30000 0))" v = Evaluate(jan) Range("B2") = v If there is a way to reduce the code so that I dont copy it 12 times for each category it would be great. Thanks for any help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for multiple columns and rows
jan = "=SumProduct(--(Sheet4!A1:A30000=" & _
"'processed Amount'!B1),--(Sheet4!AL1:AL30000 0))" v = Evaluate(jan) Range("B2") = v is there a way to loop through this code and offsett cell B1 and B2 each time the loop is completed? Thanks for any help "ram" wrote: I would like to know if the following code can be reduced: In the code below the value for €˜processed Amount!B1 is the date 1/1/2006. I currently copy the four lines of code and change cells B1 and B2 to the next columns C1 and C2€¦ M1 and M2. This gives me the data I need for all 12 months. Dim jan As String, feb As String, mar As String, apr As String, may As String, jun As String, jul As String, aug As String, sep As String, oct As String, nov As String, dec As String Dim v As Variant €˜Total CSO Reimbursements Processed jan = "=SumProduct(--(Sheet4!A1:A30000=" & _ "'processed Amount'!B1),--(Sheet4!AL1:AL30000 0))" v = Evaluate(jan) Range("B2") = v If there is a way to reduce the code so that I dont copy it 12 times for each category it would be great. Thanks for any help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Shading multiple rows or, alternately, multiple columns only | Excel Discussion (Misc queries) | |||
Delete Blank Rows Code - Multiple Worksheets - Multiple Documents | Excel Discussion (Misc queries) | |||
Excel Convert Multiple Rows into Multiple Columns | Excel Worksheet Functions | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) |