Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
A visual basic value copy BUG?? - accounting format has copy problem!! | Excel Programming | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
copy formulas from a contiguous range to a safe place and copy them back later | Excel Programming | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming |