Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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.




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
Fill colum to the next non blank row coastal Excel Discussion (Misc queries) 11 November 15th 07 10:45 PM
Need macro to check if cell is not blank & previous cell is blank, copy information from row above & paste JenIT Excel Programming 4 April 12th 07 08:56 PM
Copy to first Blank cell in Colum C Non blank cells still exist be Ulrik loves horses Excel Programming 2 October 8th 06 07:35 PM
find range of non-blank cells in colum DJS Excel Programming 3 June 26th 06 10:27 PM
COPY A CONCATENATE CELL TO BLANK CELL PUTTING IN THE NEXT BLANK C. QUEST41067 Excel Discussion (Misc queries) 1 January 15th 05 09:29 PM


All times are GMT +1. The time now is 08:52 PM.

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"