#1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default running totals

I have this VBA macro, that I think Dave Peterson wrote.....

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$5" Then
Application.EnableEvents = False
Range("E5").Value = Range("E5").Value + Target.Value
Application.EnableEvents = True
End If

End Sub

If I enter a number in B5 then the running total is in E5

I would like to adapt the Sub so that each number entered in B5 is
listed, starting in A1(or other column), like the tape on an adding
machine is visable.

Any suggestions?

  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default running totals

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$5" Then
Application.EnableEvents = False
Range("E5").Value = Range("E5").Value + Target.Value
j = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Cells(j, 1) = Target.Value
Application.EnableEvents = True
End If

End Sub

If you had lots of entries, you should also dim j as long
--
Gary''s Student


" wrote:

I have this VBA macro, that I think Dave Peterson wrote.....

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$5" Then
Application.EnableEvents = False
Range("E5").Value = Range("E5").Value + Target.Value
Application.EnableEvents = True
End If

End Sub

If I enter a number in B5 then the running total is in E5

I would like to adapt the Sub so that each number entered in B5 is
listed, starting in A1(or other column), like the tape on an adding
machine is visable.

Any suggestions?


  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default running totals

Sorry, needs a +1:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$5" Then
Application.EnableEvents = False
Range("E5").Value = Range("E5").Value + Target.Value
j = Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1
Cells(j, 1) = Target.Value
Application.EnableEvents = True
End If

End Sub

--
Gary''s Student


" wrote:

I have this VBA macro, that I think Dave Peterson wrote.....

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$5" Then
Application.EnableEvents = False
Range("E5").Value = Range("E5").Value + Target.Value
Application.EnableEvents = True
End If

End Sub

If I enter a number in B5 then the running total is in E5

I would like to adapt the Sub so that each number entered in B5 is
listed, starting in A1(or other column), like the tape on an adding
machine is visable.

Any suggestions?


  #4   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default running totals

Worked like a charm. Thanks much!

  #5   Report Post  
Posted to microsoft.public.excel.misc
Sandy Mann
 
Posts: n/a
Default running totals

MauraLae,

Try adding code to give you:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$5" Then
Endrow = Cells(Rows.Count, 1).End(xlUp).Row + 1
Application.EnableEvents = False
Cells(Endrow, 1).Value = Target.Value
Range("E5").Value = Range("E5").Value + Target.Value
Application.EnableEvents = True
End If

End Sub


--
HTH

Sandy
In Perth, the ancient capital of Scotland


with @tiscali.co.uk


wrote in message
ups.com...
I have this VBA macro, that I think Dave Peterson wrote.....

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$5" Then
Application.EnableEvents = False
Range("E5").Value = Range("E5").Value + Target.Value
Application.EnableEvents = True
End If

End Sub

If I enter a number in B5 then the running total is in E5

I would like to adapt the Sub so that each number entered in B5 is
listed, starting in A1(or other column), like the tape on an adding
machine is visable.

Any suggestions?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Summary of Multiple Worksheet Running Sum Totals karstens Excel Worksheet Functions 4 March 22nd 06 03:37 PM
How do I do running Totals in a Pivot Table Pivot Freak Excel Worksheet Functions 2 February 7th 06 05:30 PM
How do I add totals up from different sheets? A running total. Shawn Excel Worksheet Functions 3 December 21st 05 08:37 PM
How to hide unused cells when running accumulated totals grano2 Excel Worksheet Functions 1 August 13th 05 04:07 PM
Running Totals Pete New Users to Excel 2 March 23rd 05 09:37 AM


All times are GMT +1. The time now is 05:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"