Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Paste changing cell contents to consecutive cells in a column

I would like for the contents of a cell (ie: A21) to post to a cell in
another column (ie: D1). However, when the contents of A21 change I would
like for the new figure to post to the next available cell in column D (D2).
I want that process to continue in consecutive cells as the value of A21
continually changes.

Column A is a column in which I am adding figures. A21 is the sum. D would
be a record of all of those sums.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Paste changing cell contents to consecutive cells in a column

Easy to do, but I need to know if A21 changes because data is entered into it
or because it has a formula.
--
Gary''s Student - gsnu200742


"meggy" wrote:

I would like for the contents of a cell (ie: A21) to post to a cell in
another column (ie: D1). However, when the contents of A21 change I would
like for the new figure to post to the next available cell in column D (D2).
I want that process to continue in consecutive cells as the value of A21
continually changes.

Column A is a column in which I am adding figures. A21 is the sum. D would
be a record of all of those sums.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Paste changing cell contents to consecutive cells in a column

Put the following macro in worksheet code:

Private Sub Worksheet_Calculate()
n = Cells(Rows.Count, "D").End(xlUp).Row
v1 = Range("A21").Value
v2 = Cells(n, "D").Value
If v1 = v2 Then Exit Sub
Cells(n + 1, "D").Value = v1
End Sub

The recording will start in cell D2 and work downward.

REMEMBER: worksheet code, not a standard module.
--
Gary''s Student - gsnu200742


"meggy" wrote:

I would like for the contents of a cell (ie: A21) to post to a cell in
another column (ie: D1). However, when the contents of A21 change I would
like for the new figure to post to the next available cell in column D (D2).
I want that process to continue in consecutive cells as the value of A21
continually changes.

Column A is a column in which I am adding figures. A21 is the sum. D would
be a record of all of those sums.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Paste changing cell contents to consecutive cells in a column

I assume A21 has a SUM formula like =SUM(A1:A20)

This sheet event code will place the latest calculation in column D whenever the
SUM in A21 changes.

Starts entering the numbers in D2 and works its way down.

Private Sub Worksheet_Calculate()
On Error GoTo stoppit
Application.EnableEvents = False
With Me.Range("A21")
If .Value < "" Then
ActiveSheet.Cells(Rows.Count, 4).End(xlUp) _
.Offset(1, 0).Value = Me.Range("A21").Value
End If
End With
stoppit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 4 Sep 2007 10:12:02 -0700, meggy
wrote:

I would like for the contents of a cell (ie: A21) to post to a cell in
another column (ie: D1). However, when the contents of A21 change I would
like for the new figure to post to the next available cell in column D (D2).
I want that process to continue in consecutive cells as the value of A21
continually changes.

Column A is a column in which I am adding figures. A21 is the sum. D would
be a record of all of those sums.


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
How do I copy the contents of a range of text cells and paste into one cell? davfin Excel Discussion (Misc queries) 7 July 4th 06 08:16 AM
paste formula to each cell in a column without changing values mg_sv_r Excel Worksheet Functions 1 May 24th 06 11:30 AM
Insert contents of various cells in a column into one cell? TextCells Excel Discussion (Misc queries) 1 April 2nd 06 10:41 PM
How do I paste into 'consecutive' cells? warren_ds Excel Discussion (Misc queries) 3 October 8th 05 01:10 AM
copy every 30th cell in the column into consecutive cells in anoth shortcuts Excel Worksheet Functions 2 March 29th 05 07:28 AM


All times are GMT +1. The time now is 10:01 AM.

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

About Us

"It's about Microsoft Excel"