ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy to next blank cell in colum (https://www.excelbanter.com/excel-programming/403292-copy-next-blank-cell-colum.html)

MyKeyJ

copy to next blank cell in colum
 
Ok kinda new hope i get this explained correctly.
What I have - Sheet 1 cell a1 will be receiving numbers from an outside
application. Each time a new number is pasted to this cell I need it to be
copied to the next availble cell in another colum. Basicly i want to create
a list of all the numbers that are pasted to cell A1. I have set a macro up
on the sheet to copy cell A1 and paste it to another sheet when ever the data
in cell a1 is changed. My problem is creating the list - specificly getting
the new number to be pasted to the next blank cell in the specified colum.

Mike Fogleman

copy to next blank cell in colum
 
Put this code in Worksheet 1 code module

Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastRow As Long, ws As Worksheet

If Not Target.Address = "$A$1" Then Exit Sub

Set ws = Worksheets("Sheet2")
LastRow = ws.Cells(Rows.Count, "B").End(xlUp).Row
ws.Range("B" & LastRow + 1).Value = Target.Value

End Sub
Mike F
"MyKeyJ" wrote in message
...
Ok kinda new hope i get this explained correctly.
What I have - Sheet 1 cell a1 will be receiving numbers from an outside
application. Each time a new number is pasted to this cell I need it to
be
copied to the next availble cell in another colum. Basicly i want to
create
a list of all the numbers that are pasted to cell A1. I have set a macro
up
on the sheet to copy cell A1 and paste it to another sheet when ever the
data
in cell a1 is changed. My problem is creating the list - specificly
getting
the new number to be pasted to the next blank cell in the specified colum.




MyKeyJ

copy to next blank cell in colum
 
Thank You.
The provided code works perfect.

Thanks for your help.

MJ

"Mike Fogleman" wrote:

Put this code in Worksheet 1 code module

Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastRow As Long, ws As Worksheet

If Not Target.Address = "$A$1" Then Exit Sub

Set ws = Worksheets("Sheet2")
LastRow = ws.Cells(Rows.Count, "B").End(xlUp).Row
ws.Range("B" & LastRow + 1).Value = Target.Value

End Sub
Mike F
"MyKeyJ" wrote in message
...
Ok kinda new hope i get this explained correctly.
What I have - Sheet 1 cell a1 will be receiving numbers from an outside
application. Each time a new number is pasted to this cell I need it to
be
copied to the next availble cell in another colum. Basicly i want to
create
a list of all the numbers that are pasted to cell A1. I have set a macro
up
on the sheet to copy cell A1 and paste it to another sheet when ever the
data
in cell a1 is changed. My problem is creating the list - specificly
getting
the new number to be pasted to the next blank cell in the specified colum.






All times are GMT +1. The time now is 02:44 PM.

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