Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Pretty easy but, as always, post YOUR coding efforts for comments
-- Don Guillett SalesAid Software "Benz" wrote in message ... Hello, I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry,
Code: Sub TESTINGTRANSFER() Selection.Copy Sheets("A").Select Selection.Select Sheets("B").Select.Range("A1").End(xlDown).Offset( 1, 0).Paste Application.CutCopyMode = False Selection.Delete Shift:=xlUp End Sub Thanks Don. "Don Guillett" wrote: Pretty easy but, as always, post YOUR coding efforts for comments -- Don Guillett SalesAid Software "Benz" wrote in message ... Hello, I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I try that I get the error; "Application - defined or object - defined
error" "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 Sub TESTINGTRANSFER() Selection.EntireRow.Cut Destination:= _ Sheets("sheet18").Range("A1").End(xlDown).Offset(1 ) End Sub -- Don Guillett SalesAid Software "Benz" wrote in message ... Sorry, Code: Sub TESTINGTRANSFER() Selection.Copy Sheets("A").Select Selection.Select Sheets("B").Select.Range("A1").End(xlDown).Offset( 1, 0).Paste Application.CutCopyMode = False Selection.Delete Shift:=xlUp End Sub Thanks Don. "Don Guillett" wrote: Pretty easy but, as always, post YOUR coding efforts for comments -- Don Guillett SalesAid Software "Benz" wrote in message ... Hello, I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This will fail if there is nothing after a1 so you may prefer
..cells(rows.count,"a").end(xlup).row+1 -- Don Guillett SalesAid Software "Benz" wrote in message ... When I try that I get the error; "Application - defined or object - defined error" "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 Sub TESTINGTRANSFER() Selection.EntireRow.Cut Destination:= _ Sheets("sheet18").Range("A1").End(xlDown).Offset(1 ) End Sub -- Don Guillett SalesAid Software "Benz" wrote in message ... Sorry, Code: Sub TESTINGTRANSFER() Selection.Copy Sheets("A").Select Selection.Select Sheets("B").Select.Range("A1").End(xlDown).Offset( 1, 0).Paste Application.CutCopyMode = False Selection.Delete Shift:=xlUp End Sub Thanks Don. "Don Guillett" wrote: Pretty easy but, as always, post YOUR coding efforts for comments -- Don Guillett SalesAid Software "Benz" wrote in message ... Hello, I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I tried that is when I receive the error.
"Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 -- Don Guillett SalesAid Software "Benz" wrote in message ... When I try that I get the error; "Application - defined or object - defined error" "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 Sub TESTINGTRANSFER() Selection.EntireRow.Cut Destination:= _ Sheets("sheet18").Range("A1").End(xlDown).Offset(1 ) End Sub -- Don Guillett SalesAid Software "Benz" wrote in message ... Sorry, Code: Sub TESTINGTRANSFER() Selection.Copy Sheets("A").Select Selection.Select Sheets("B").Select.Range("A1").End(xlDown).Offset( 1, 0).Paste Application.CutCopyMode = False Selection.Delete Shift:=xlUp End Sub Thanks Don. "Don Guillett" wrote: Pretty easy but, as always, post YOUR coding efforts for comments -- Don Guillett SalesAid Software "Benz" wrote in message ... Hello, I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
copy/paste your entire code here
-- Don Guillett SalesAid Software "Benz" wrote in message ... When I tried that is when I receive the error. "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 -- Don Guillett SalesAid Software "Benz" wrote in message ... When I try that I get the error; "Application - defined or object - defined error" "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 Sub TESTINGTRANSFER() Selection.EntireRow.Cut Destination:= _ Sheets("sheet18").Range("A1").End(xlDown).Offset(1 ) End Sub -- Don Guillett SalesAid Software "Benz" wrote in message ... Sorry, Code: Sub TESTINGTRANSFER() Selection.Copy Sheets("A").Select Selection.Select Sheets("B").Select.Range("A1").End(xlDown).Offset( 1, 0).Paste Application.CutCopyMode = False Selection.Delete Shift:=xlUp End Sub Thanks Don. "Don Guillett" wrote: Pretty easy but, as always, post YOUR coding efforts for comments -- Don Guillett SalesAid Software "Benz" wrote in message ... Hello, I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I originaly tried what you said :
Sub TESTINGTRANSFER2() Selection.EntireRow.Cut Destination:= _ Sheets("B").Cells(Rows.Count, "a").End(xlUp).Row + 1 End Sub Then I received an error. So I tried fussing with it and tried this: Sub TESTINGTRANSFER() Selection.EntireRow.Copy Destination:= _ Sheets("B").Range("A1").End(xlDown).Offset(1) Selection.Delete Shift:=xlUp End Sub Im not the greatest at VBA but this is so confusing to me. Thank you for your help, its probaly frustrating to you. "Don Guillett" wrote: copy/paste your entire code here -- Don Guillett SalesAid Software "Benz" wrote in message ... When I tried that is when I receive the error. "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 -- Don Guillett SalesAid Software "Benz" wrote in message ... When I try that I get the error; "Application - defined or object - defined error" "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 Sub TESTINGTRANSFER() Selection.EntireRow.Cut Destination:= _ Sheets("sheet18").Range("A1").End(xlDown).Offset(1 ) End Sub -- Don Guillett SalesAid Software "Benz" wrote in message ... Sorry, Code: Sub TESTINGTRANSFER() Selection.Copy Sheets("A").Select Selection.Select Sheets("B").Select.Range("A1").End(xlDown).Offset( 1, 0).Paste Application.CutCopyMode = False Selection.Delete Shift:=xlUp End Sub Thanks Don. "Don Guillett" wrote: Pretty easy but, as always, post YOUR coding efforts for comments -- Don Guillett SalesAid Software "Benz" wrote in message ... Hello, I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you like send your workbook to my email below along with this email and
specific instructions on what your are trying to do. -- Don Guillett SalesAid Software "Benz" wrote in message ... I originaly tried what you said : Sub TESTINGTRANSFER2() Selection.EntireRow.Cut Destination:= _ Sheets("B").Cells(Rows.Count, "a").End(xlUp).Row + 1 End Sub Then I received an error. So I tried fussing with it and tried this: Sub TESTINGTRANSFER() Selection.EntireRow.Copy Destination:= _ Sheets("B").Range("A1").End(xlDown).Offset(1) Selection.Delete Shift:=xlUp End Sub Im not the greatest at VBA but this is so confusing to me. Thank you for your help, its probaly frustrating to you. "Don Guillett" wrote: copy/paste your entire code here -- Don Guillett SalesAid Software "Benz" wrote in message ... When I tried that is when I receive the error. "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 -- Don Guillett SalesAid Software "Benz" wrote in message ... When I try that I get the error; "Application - defined or object - defined error" "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 Sub TESTINGTRANSFER() Selection.EntireRow.Cut Destination:= _ Sheets("sheet18").Range("A1").End(xlDown).Offset(1 ) End Sub -- Don Guillett SalesAid Software "Benz" wrote in message ... Sorry, Code: Sub TESTINGTRANSFER() Selection.Copy Sheets("A").Select Selection.Select Sheets("B").Select.Range("A1").End(xlDown).Offset( 1, 0).Paste Application.CutCopyMode = False Selection.Delete Shift:=xlUp End Sub Thanks Don. "Don Guillett" wrote: Pretty easy but, as always, post YOUR coding efforts for comments -- Don Guillett SalesAid Software "Benz" wrote in message ... Hello, I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I Sent you an e-mail, have you received it?
"Don Guillett" wrote: If you like send your workbook to my email below along with this email and specific instructions on what your are trying to do. -- Don Guillett SalesAid Software "Benz" wrote in message ... I originaly tried what you said : Sub TESTINGTRANSFER2() Selection.EntireRow.Cut Destination:= _ Sheets("B").Cells(Rows.Count, "a").End(xlUp).Row + 1 End Sub Then I received an error. So I tried fussing with it and tried this: Sub TESTINGTRANSFER() Selection.EntireRow.Copy Destination:= _ Sheets("B").Range("A1").End(xlDown).Offset(1) Selection.Delete Shift:=xlUp End Sub Im not the greatest at VBA but this is so confusing to me. Thank you for your help, its probaly frustrating to you. "Don Guillett" wrote: copy/paste your entire code here -- Don Guillett SalesAid Software "Benz" wrote in message ... When I tried that is when I receive the error. "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 -- Don Guillett SalesAid Software "Benz" wrote in message ... When I try that I get the error; "Application - defined or object - defined error" "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 Sub TESTINGTRANSFER() Selection.EntireRow.Cut Destination:= _ Sheets("sheet18").Range("A1").End(xlDown).Offset(1 ) End Sub -- Don Guillett SalesAid Software "Benz" wrote in message ... Sorry, Code: Sub TESTINGTRANSFER() Selection.Copy Sheets("A").Select Selection.Select Sheets("B").Select.Range("A1").End(xlDown).Offset( 1, 0).Paste Application.CutCopyMode = False Selection.Delete Shift:=xlUp End Sub Thanks Don. "Don Guillett" wrote: Pretty easy but, as always, post YOUR coding efforts for comments -- Don Guillett SalesAid Software "Benz" wrote in message ... Hello, I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use this instead. Notice the . in the with statement . Workbook forwarded
Sub TESTINGTRANSFER2() With Sheets("process") lr = .Cells(.Rows.Count, "a").End(xlUp).Row + 1 Selection.EntireRow.Cut Destination:=.Cells(lr, "a") End With End Sub -- Don Guillett SalesAid Software "Don Guillett" wrote in message ... If you like send your workbook to my email below along with this email and specific instructions on what your are trying to do. -- Don Guillett SalesAid Software "Benz" wrote in message ... I originaly tried what you said : Sub TESTINGTRANSFER2() Selection.EntireRow.Cut Destination:= _ Sheets("B").Cells(Rows.Count, "a").End(xlUp).Row + 1 End Sub Then I received an error. So I tried fussing with it and tried this: Sub TESTINGTRANSFER() Selection.EntireRow.Copy Destination:= _ Sheets("B").Range("A1").End(xlDown).Offset(1) Selection.Delete Shift:=xlUp End Sub Im not the greatest at VBA but this is so confusing to me. Thank you for your help, its probaly frustrating to you. "Don Guillett" wrote: copy/paste your entire code here -- Don Guillett SalesAid Software "Benz" wrote in message ... When I tried that is when I receive the error. "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 -- Don Guillett SalesAid Software "Benz" wrote in message ... When I try that I get the error; "Application - defined or object - defined error" "Don Guillett" wrote: This will fail if there is nothing after a1 so you may prefer ..cells(rows.count,"a").end(xlup).row+1 Sub TESTINGTRANSFER() Selection.EntireRow.Cut Destination:= _ Sheets("sheet18").Range("A1").End(xlDown).Offset(1 ) End Sub -- Don Guillett SalesAid Software "Benz" wrote in message ... Sorry, Code: Sub TESTINGTRANSFER() Selection.Copy Sheets("A").Select Selection.Select Sheets("B").Select.Range("A1").End(xlDown).Offset( 1, 0).Paste Application.CutCopyMode = False Selection.Delete Shift:=xlUp End Sub Thanks Don. "Don Guillett" wrote: Pretty easy but, as always, post YOUR coding efforts for comments -- Don Guillett SalesAid Software "Benz" wrote in message ... Hello, I have what I would imagine to be a pretty simple question. I'm having trouble getting a macro to copy the selected row in sheet "A" and paste in the first available row in sheet "B" and then delete the content from the original row in Sheet "A". I can just almost get it but not quiet. Thank you to anyone that helps. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy data into new line on seperate sheet? | Excel Discussion (Misc queries) | |||
To copy the formula in one cell to another in a seperate sheet | Excel Discussion (Misc queries) | |||
Macro to copy Column 1 of all sheets to a seperate sheet. | Excel Programming | |||
Active Cell Copy And Paste Sheet to Sheet | New Users to Excel | |||
copy all named ranges in a sheet to seperate sheets | Excel Programming |