Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default copy on the next available row

Here is my macro now:


Private Sub Worksheet_Change(ByVal Target As Range)


If Intersect(Target, Range("A33:O49")) Is Nothing Then Exit Sub
If Range("O" & Target.Row) = "" Then Exit Sub
Target.EntireRow.Copy
Application.EnableEvents = False


taddress = (1, Target.Column).End(xlDown).Address


With Sheets("Rapport des transactions")
.Range(taddress).PasteSpecial xlPasteAll
End With


Application.EnableEvents = True


End Sub


I'm trying to copy my info in the first empty row of sheet "Rapport des

Transactions" in the same column as the target. What should i change
because it doesn't work?


Thank you
MP

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default copy on the next available row

Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Range("A33:O49")) Is Nothing Then Exit Sub
If Range("O" & Target.Row) = "" Then Exit Sub

Application.EnableEvents = False
Target.EntireRow.Copy _
Destination:=Sheets("Rapport des transactions").Cells(rows.count, _
"A").end(xlUp).offset(1,0)
Application.EnableEvents = True
End Sub

--
HTH...

Jim Thomlinson


" wrote:

Here is my macro now:


Private Sub Worksheet_Change(ByVal Target As Range)


If Intersect(Target, Range("A33:O49")) Is Nothing Then Exit Sub
If Range("O" & Target.Row) = "" Then Exit Sub
Target.EntireRow.Copy
Application.EnableEvents = False


taddress = (1, Target.Column).End(xlDown).Address


With Sheets("Rapport des transactions")
.Range(taddress).PasteSpecial xlPasteAll
End With


Application.EnableEvents = True


End Sub


I'm trying to copy my info in the first empty row of sheet "Rapport des

Transactions" in the same column as the target. What should i change
because it doesn't work?


Thank you
MP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default copy on the next available row

With Sheets("Rapport des transactions")
taddress = .Cells((rows.count, Target.Column).End(xlup).Offset(1,0).row
.Range("A" & taddress).PasteSpecial xlPasteAll
End With


or
With Sheets("Rapport des transactions")
.Cells(.Cells(rows.count, Target.Column).End(xlup) _
.Offset(1,0).row,1).PasteSpecial xlPasteAll
End With

--
Regards,
Tom Ogilvy

" wrote:

Here is my macro now:


Private Sub Worksheet_Change(ByVal Target As Range)


If Intersect(Target, Range("A33:O49")) Is Nothing Then Exit Sub
If Range("O" & Target.Row) = "" Then Exit Sub
Target.EntireRow.Copy
Application.EnableEvents = False


taddress = (1, Target.Column).End(xlDown).Address


With Sheets("Rapport des transactions")
.Range(taddress).PasteSpecial xlPasteAll
End With


Application.EnableEvents = True


End Sub


I'm trying to copy my info in the first empty row of sheet "Rapport des

Transactions" in the same column as the target. What should i change
because it doesn't work?


Thank you
MP


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default copy on the next available row

thanks it is working

MP

Tom Ogilvy a écrit :

With Sheets("Rapport des transactions")
taddress = .Cells((rows.count, Target.Column).End(xlup).Offset(1,0).row
.Range("A" & taddress).PasteSpecial xlPasteAll
End With


or
With Sheets("Rapport des transactions")
.Cells(.Cells(rows.count, Target.Column).End(xlup) _
.Offset(1,0).row,1).PasteSpecial xlPasteAll
End With

--
Regards,
Tom Ogilvy

" wrote:

Here is my macro now:


Private Sub Worksheet_Change(ByVal Target As Range)


If Intersect(Target, Range("A33:O49")) Is Nothing Then Exit Sub
If Range("O" & Target.Row) = "" Then Exit Sub
Target.EntireRow.Copy
Application.EnableEvents = False


taddress = (1, Target.Column).End(xlDown).Address


With Sheets("Rapport des transactions")
.Range(taddress).PasteSpecial xlPasteAll
End With


Application.EnableEvents = True


End Sub


I'm trying to copy my info in the first empty row of sheet "Rapport des

Transactions" in the same column as the target. What should i change
because it doesn't work?


Thank you
MP



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
A visual basic value copy BUG?? - accounting format has copy problem!! [email protected] Excel Programming 3 June 20th 06 04:42 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
copy formulas from a contiguous range to a safe place and copy them back later Lucas Budlong Excel Programming 2 February 22nd 06 08:26 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM


All times are GMT +1. The time now is 09:39 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"