Going from total to details

O

Orlando

Hi guys, lets say I have 2 worksheets, 1 have the totals of the bank account
per concept and month and in the other one I have the details of those
totals, I wonder if I can do the next: If I double click one of the totals
there is a way to show the detail of this concept for the month?

The totals worksheet is something like that

Concept january February ....
Salary 2050 2000
groceries 250 300
movies 50 75

If you guys need more info let me know

Thanks
 
D

Dave Peterson

Depending on how your data is laid out on the detail page, you may want to
consider using data|pivottable to create the summary.

You can double click on one of the summary cells and see the details that were
used to get that total.
 
O

Orlando

You are right I need to change the way I laid out the data in the detail
worksheet, that why I have another question is possible to create a VBA
routine and get this routine active all the time, for example I create the
next code to update the totals worksheet but I created in a commandButton, I
dont want the user to press the buttom to update the sumary field, I want
this code to run went new information is add to the detail worksheet.

This is the code, and the cell Cells(5, 2) is the name of the concept for
example (Salary). Thanks

Private Sub CommandButton1_Click()
Dim Acumula As Integer
Acumula = 0

With Worksheets("Detail")
Set r = .Range(.Cells(1, 13), .Cells(100, 15))

For n = 1 To r.Rows.Count
If r.Cells(n, 1) = Cells(5, 2) Then
Acumula = Acumula + r.Cells(n, 3)
End If
Next n

End With
Cells(5, 4) = Acumula
End Sub
 
D

Dave Peterson

It looks as though your code could be replaced with a worksheet function.

=sumif(detail!$m$1:$m$100,$b$2,detail!$o$1:$o$100)

(If I read it correctly.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top