Copy non sequential cells and paste to a new sheet

jgalas

Board Regular
Joined
Jul 4, 2011
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
Hi everyone

I want to copy every row of sheets ("RegDupla") to the last aviable row of sheet("Registos") in this way:

Sheets (RegDupla).range("D1") to sheets(Registos).range(B#)
Sheets (RegDupla).range("D2") to sheets(Registos).range(AC#)
Sheets (RegDupla).range("I2") to sheets(Registos).range(AD#)
Sheets (RegDupla).range("B#") to sheets(Registos).range(A#)
Sheets (RegDupla).range("D#:AC#") to sheets(Registos).range(C#:AB#)

# it's the number of the row... in sheets(RegDupla) can be 10 for exemple and 1254 in the sheets(Registos).

Can anyone help me on this please <!-- / message -->
 
Last edited:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Re: copy and paste data mixed in other sheet

Well, your first 3 lines:
Code:
[/COLOR]Sheets (RegDupla).range("D1") to sheets(Registos).range(B#)
Sheets (RegDupla).range("D2") to sheets(Registos).range(AC#)
Sheets (RegDupla).range("I2") to sheets(Registos).range(AD#)[/COLOR]
would be written like so:
Code:
[/COLOR][/COLOR]Sheets("RegDupla").Range("D1").Copy Sheets("Registos").Cells(Rows.Count, "B").End(xlUp)(2)
Sheets("RegDupla").Range("D2").Copy Sheets("Registos").Cells(Rows.Count, "AC").End(xlUp)(2)
Sheets("RegDupla").Range("I2").Copy Sheets("Registos").Cells(Rows.Count, "AD").End(xlUp)(2)

But I'm not clear on what you want to copy from the RegDupla sheet with those last two lines...
 
Upvote 0
For each row in sheet (RegDupla) i will have one row in sheet(Registos)
like this:

Sheets (RegDupla).range("D1") to sheets(Registos).range(B#)
Sheets (RegDupla).range("D2") to sheets(Registos).range(AC#)
Sheets (RegDupla).range("I2") to sheets(Registos).range(AD#)
Sheets (RegDupla).range("B#") to sheets(Registos).range(A#)
Sheets (RegDupla).range("D#:AC#") to sheets(Registos).range(C#:AB#)

Range D1, D2 and I2 are allways the same.
 
Upvote 0
Re: copy and paste data mixed in other sheet

But I'm not clear on what you want to copy from the RegDupla sheet with those last two lines...

I want to copy the data in row 4, 5, 6, ...35 of column "B" from sheet (RegDupla) to row 4,5,6,....,35 column "A" of sheet (Registos)


Same to
Sheets (RegDupla).range("D#:AC#") to sheets(Registos).range(C#:AB#)
 
Upvote 0
Re: copy and paste data mixed in other sheet

I know sintaxe it no right... but this is what i want

for i = 4 to 35
Sheets (RegDupla).range("B" & i) to sheets(Registos).range("A" & i)
Sheets (RegDupla).range("D" & i : "AC" & i) to sheets(Registos).range("C" & i : "AB" & i)
next i

Can it be done?
 
Upvote 0
Re: copy and paste data mixed in other sheet

Well, your first 3 lines:
Code:
Sheets (RegDupla).range("D1") to sheets(Registos).range(B#)
Sheets (RegDupla).range("D2") to sheets(Registos).range(AC#)
Sheets (RegDupla).range("I2") to sheets(Registos).range(AD#)
would be written like so:
Code:
Sheets("RegDupla").Range("D1").Copy Sheets("Registos").Cells(Rows.Count, "B").End(xlUp)(2)
Sheets("RegDupla").Range("D2").Copy Sheets("Registos").Cells(Rows.Count, "AC").End(xlUp)(2)
Sheets("RegDupla").Range("I2").Copy Sheets("Registos").Cells(Rows.Count, "AD").End(xlUp)(2)
.


Can it be copied without any formatting or formulas, paste the values ​​only?
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,555
Members
452,928
Latest member
101blockchains

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