PC Review


Reply
Thread Tools Rate Thread

Copy date from row 1 to last row next sheet

 
 
MyKeyJ
Guest
Posts: n/a
 
      28th Dec 2007
Need some help I am currently using this macro -
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, "c").End(xlUp).Row
ws.Range("c" & LastRow + 1).Value = Target.Value

End Sub

Works great for coping one cell. But how can i increase the copy area - I
need to copy Cells A1:N1 to sheet2 last row C1:P1 when ever sheet1 A1:N1 are
changed. I could actaully use N1 as the triger if needed. Set up is an out
side programm will be pasting data to sheet1 A1:N1 for each record, I need to
then copy that row of information to create a list on another worksheet.

Thanks to anyone that can help.
 
Reply With Quote
 
 
 
 
Otto Moehrbach
Guest
Posts: n/a
 
      28th Dec 2007
Try this macro. Note that this macro will copy A1:N1 to "C" & the last row
EACH TIME that ANY ONE of the A1:N1 cells is changed. Come back if this is
not what you want. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastRow As Long
If Not Intersect(Target, Range("A1:N1")) Is Nothing Then
With Worksheets("Sheet2")
LastRow = .Cells(Rows.Count, "c").End(xlUp).Row
Range("A1:N1").Copy .Range("c" & LastRow + 1)
End With
End If
End Sub

"MyKeyJ" <(E-Mail Removed)> wrote in message
news6DD9B7B-81F1-4FE3-A30C-(E-Mail Removed)...
> Need some help I am currently using this macro -
> 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, "c").End(xlUp).Row
> ws.Range("c" & LastRow + 1).Value = Target.Value
>
> End Sub
>
> Works great for coping one cell. But how can i increase the copy area - I
> need to copy Cells A1:N1 to sheet2 last row C1:P1 when ever sheet1 A1:N1
> are
> changed. I could actaully use N1 as the triger if needed. Set up is an
> out
> side programm will be pasting data to sheet1 A1:N1 for each record, I need
> to
> then copy that row of information to create a list on another worksheet.
>
> Thanks to anyone that can help.



 
Reply With Quote
 
MyKeyJ
Guest
Posts: n/a
 
      28th Dec 2007
works good, except the data is entered one cell at a time, and i am thinking
if it would wait till the last cell (N1) is updated then copy the row A1:N1
to sheet2 would be much more practical.

Otto thanks for your help.

MJ.

"Otto Moehrbach" wrote:

> Try this macro. Note that this macro will copy A1:N1 to "C" & the last row
> EACH TIME that ANY ONE of the A1:N1 cells is changed. Come back if this is
> not what you want. HTH Otto
> Private Sub Worksheet_Change(ByVal Target As Range)
> Dim LastRow As Long
> If Not Intersect(Target, Range("A1:N1")) Is Nothing Then
> With Worksheets("Sheet2")
> LastRow = .Cells(Rows.Count, "c").End(xlUp).Row
> Range("A1:N1").Copy .Range("c" & LastRow + 1)
> End With
> End If
> End Sub
>
> "MyKeyJ" <(E-Mail Removed)> wrote in message
> news6DD9B7B-81F1-4FE3-A30C-(E-Mail Removed)...
> > Need some help I am currently using this macro -
> > 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, "c").End(xlUp).Row
> > ws.Range("c" & LastRow + 1).Value = Target.Value
> >
> > End Sub
> >
> > Works great for coping one cell. But how can i increase the copy area - I
> > need to copy Cells A1:N1 to sheet2 last row C1:P1 when ever sheet1 A1:N1
> > are
> > changed. I could actaully use N1 as the triger if needed. Set up is an
> > out
> > side programm will be pasting data to sheet1 A1:N1 for each record, I need
> > to
> > then copy that row of information to create a list on another worksheet.
> >
> > Thanks to anyone that can help.

>
>
>

 
Reply With Quote
 
Otto Moehrbach
Guest
Posts: n/a
 
      28th Dec 2007
How about this? This macro will do the copying/pasting only if an entry is
made in N1. Otto
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastRow As Long
If Not Intersect(Target, Range("N1")) Is Nothing Then
With Worksheets("Sheet2")
LastRow = .Cells(Rows.Count, "c").End(xlUp).Row
Range("A1:N1").Copy .Range("c" & LastRow + 1)
End With
End If
End Sub
"MyKeyJ" <(E-Mail Removed)> wrote in message
news196910F-4D59-4358-B08B-(E-Mail Removed)...
> works good, except the data is entered one cell at a time, and i am
> thinking
> if it would wait till the last cell (N1) is updated then copy the row
> A1:N1
> to sheet2 would be much more practical.
>
> Otto thanks for your help.
>
> MJ.
>
> "Otto Moehrbach" wrote:
>
>> Try this macro. Note that this macro will copy A1:N1 to "C" & the last
>> row
>> EACH TIME that ANY ONE of the A1:N1 cells is changed. Come back if this
>> is
>> not what you want. HTH Otto
>> Private Sub Worksheet_Change(ByVal Target As Range)
>> Dim LastRow As Long
>> If Not Intersect(Target, Range("A1:N1")) Is Nothing Then
>> With Worksheets("Sheet2")
>> LastRow = .Cells(Rows.Count, "c").End(xlUp).Row
>> Range("A1:N1").Copy .Range("c" & LastRow + 1)
>> End With
>> End If
>> End Sub
>>
>> "MyKeyJ" <(E-Mail Removed)> wrote in message
>> news6DD9B7B-81F1-4FE3-A30C-(E-Mail Removed)...
>> > Need some help I am currently using this macro -
>> > 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, "c").End(xlUp).Row
>> > ws.Range("c" & LastRow + 1).Value = Target.Value
>> >
>> > End Sub
>> >
>> > Works great for coping one cell. But how can i increase the copy area -
>> > I
>> > need to copy Cells A1:N1 to sheet2 last row C1:P1 when ever sheet1
>> > A1:N1
>> > are
>> > changed. I could actaully use N1 as the triger if needed. Set up is
>> > an
>> > out
>> > side programm will be pasting data to sheet1 A1:N1 for each record, I
>> > need
>> > to
>> > then copy that row of information to create a list on another
>> > worksheet.
>> >
>> > Thanks to anyone that can help.

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy rows with today's date to new sheet DavidH56 Microsoft Excel Programming 1 25th Jun 2008 03:06 PM
Sort by Date and Copy results to another sheet Pat-UK Microsoft Excel New Users 6 17th Mar 2008 12:02 PM
COPY SAME DATE/CELL TO EVERY SHEET? =?Utf-8?B?U1RFVkU=?= Microsoft Excel Misc 8 2nd Oct 2006 07:25 PM
how do i copy various sheets date to one sheet in the same excel . =?Utf-8?B?ZGluZXNo?= Microsoft Excel Worksheet Functions 0 15th Sep 2006 02:06 PM
Copy data from sheet 1 to sheet 2 based on day/date jonpdavies@gmail.com Microsoft Excel Programming 7 1st Oct 2005 04:59 PM


Features
 

Advertising
 

Newsgroups
 


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