ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code not going to next unused row (https://www.excelbanter.com/excel-programming/306377-code-not-going-next-unused-row.html)

goss[_30_]

Code not going to next unused row
 
Hi ng
using xl 2003

My code is not pasting to next unused row
Should begin pasting row 9

Every time I run the code pastes further down and down

What am I doing wrong?

Sub Add_Employee()
Worksheets("mytools").Activate
Range("A1:J7").Select
With Range("A1:J7")
.Copy
End With

Worksheets("Time_Entry").Activate
Cells(Cells.SpecialCells(xlCellTypeLastCell).Row, 1).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Su

--
Message posted from http://www.ExcelForum.com


John Howard

Code not going to next unused row
 
Try adding "+1" after the .Row in your SpeccialCells line

eg.

Cells(Cells.SpecialCells(xlCellTypeLastCell).Row+1 , 1).Select

"goss " wrote in message
...
Hi ng
using xl 2003

My code is not pasting to next unused row
Should begin pasting row 9

Every time I run the code pastes further down and down

What am I doing wrong?

Sub Add_Employee()
Worksheets("mytools").Activate
Range("A1:J7").Select
With Range("A1:J7")
Copy
End With

Worksheets("Time_Entry").Activate
Cells(Cells.SpecialCells(xlCellTypeLastCell).Row, 1).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub


---
Message posted from http://www.ExcelForum.com/




William[_2_]

Code not going to next unused row
 
Hi goss

Try

Sub Add_Employee()
Worksheets("mytools").Range("A1:J7").Copy _
Worksheets("Time_Entry").Range("A65000").End(xlUp) .Offset(1, 0)
End Sub

--
XL2002
Regards

William



"goss " wrote in message
...
| Hi ng
| using xl 2003
|
| My code is not pasting to next unused row
| Should begin pasting row 9
|
| Every time I run the code pastes further down and down
|
| What am I doing wrong?
|
| Sub Add_Employee()
| Worksheets("mytools").Activate
| Range("A1:J7").Select
| With Range("A1:J7")
| Copy
| End With
|
| Worksheets("Time_Entry").Activate
| Cells(Cells.SpecialCells(xlCellTypeLastCell).Row, 1).Select
| ActiveSheet.Paste
| Application.CutCopyMode = False
| End Sub
|
|
| ---
| Message posted from
http://www.ExcelForum.com/
|




All times are GMT +1. The time now is 07:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com