Hello Everyone,
Just facing the problem. I m getting data on daily basis against the ID in the form of of excel spreadsheet. I need Row Sum between a user specified column. so i m looking for an macro that it will automatically run, takes the input from the user for the specified 2 columns and shows the sum of between two columns.
Actually I have two Sheets in a Excel file.
Sheet 1:
Sheet 2:
Written Code on excel VBA as it needs to be more refine but i m stuck
BELOW The result which is actually i need:
BestRegards
Masam
Just facing the problem. I m getting data on daily basis against the ID in the form of of excel spreadsheet. I need Row Sum between a user specified column. so i m looking for an macro that it will automatically run, takes the input from the user for the specified 2 columns and shows the sum of between two columns.
Actually I have two Sheets in a Excel file.
Sheet 1:
Code:
ID MaxDate Last Date TOTALSUM
1543 04/03/2011 02/03/2011
1544 04/03/2011 01/03/2011
Code:
ID 1-Mar-11 2-Mar-11 3-Mar-11 4-Mar-11
1543 21 7.6 8.2 9.1
1544 11 2.6 4.5 10.0
Code:
Sub Combined()
A = 1
B = 1
For I = 0 To 4
For j = 0 To 4
If Sheet1.Range("A1").Offset(I, 0) = Sheet2.Range("A1").Offset(j + 1, 0) Then
If Sheet1.Range("A1").Offset(I, 1) = Sheet2.Range("A1").Offset(0, j + 1) Then
Do
e = Sheet2.Range("A1").Offset(A, B) + Sheet2.Range("A1").Offset(A + j + 1, B + j + 1)
Loop Until Sheet1.Range("A1").Offset(d, 0) <> Sheet2.Range("A1").Offset(f, 0)
Sheet1.Range("A1").Offset(1, 3) = e
Else
B = B + 1
End If
Else
A = A + 1
End If
Next j
Next I
Sheet1.Range("A1").Offset(1, 3) = e
End Sub
Code:
ID MaxDate Last Date TOTALSUM
1543 04/03/2011 03/03/2011 17.3
1544 04/03/2011 01/03/2011 28.1
Masam