ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running Totals (https://www.excelbanter.com/excel-programming/290929-running-totals.html)

muziq2[_2_]

Running Totals
 
Using the following I was able to create a running total column for th
specified cell.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo stoppit
If Target.Address = "$A$2" And Target.Value < "" Then
ActiveSheet.Cells(Rows.Count, 2).End(xlUp) _
.Offset(1, 0).Value = Target.Value
End If
stoppit:
End Sub

How would I edit this to have a seperate column for each cell in colum
A, say cells A2:A52 (i.e. cell A2 would be displayed in column B, cel
A3 would be displayed in column C, cell A4 would be displayed in colum
D, etc...)? Pleae help.

Thanks,

Jef

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Running Totals
 
Jeff,

I think this is what you are asking for

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo stoppit
With Target
If .Column = 1 And .Value < "" Then
Cells(Rows.Count, .Row).End(xlUp).Offset(1, 0).Value = .Value
End If
End With
stoppit:
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"muziq2 " wrote in message
...
Using the following I was able to create a running total column for the
specified cell.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo stoppit
If Target.Address = "$A$2" And Target.Value < "" Then
ActiveSheet.Cells(Rows.Count, 2).End(xlUp) _
Offset(1, 0).Value = Target.Value
End If
stoppit:
End Sub

How would I edit this to have a seperate column for each cell in column
A, say cells A2:A52 (i.e. cell A2 would be displayed in column B, cell
A3 would be displayed in column C, cell A4 would be displayed in column
D, etc...)? Pleae help.

Thanks,

Jeff


---
Message posted from http://www.ExcelForum.com/




muziq2[_3_]

Running Totals
 
Bob,

It worked perfectly. Thanks so much for your help.

Jef

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 11:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com