Skip a line after the last record

RCONDADO

New Member
Joined
Nov 4, 2014
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Dear all,

I'm creating a macro to compile some information into a spreadsheet, and inside it, I'm using the following code:

" Sheets("Controle").Select
Sheets("Controle_Draft").Visible = True
Range(Selection, Selection.End(xlToRight)).Select
Sheets("Controle_Draft").Select
Range("A2:L9").Select
Selection.Copy
Sheets("Controle").Select
Range("A1").Select
Selection.End(xlDown).Select
Sheets("Controle").Rows("2:2").Insert Shift:=xlDown
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Controle_Draft").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Controle").Select
Range("A1").Select
Selection.End(xlDown).Select "

After that, I entered the code to paste the information. The main idea is that it finds the last filled row, and pastes the information from the source sheet, but it's overwriting the last record and doesn't do anything after row 8.

Please could you help me?

Thank you in advance.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
"xlDown" will take you to the last populated row, not the first blank row after that.
You can use .Offset(1,0) to move one row down from that.

If you need more help, I would recommend posting some samples of the data you are trying to copy, and the destination you are trying to copy it to (I think it would be much easier for us to follow along to view your data that to try to decipher code with no idea of what your data looks like).

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,915
Members
448,532
Latest member
9Kimo3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top