ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I copy several rows from one sheet to another? (https://www.excelbanter.com/excel-programming/445555-how-do-i-copy-several-rows-one-sheet-another.html)

Saucer Man

How do I copy several rows from one sheet to another?
 
I am currently doing...

ActQty.Entirerow.Copy Destination:=Sheets(1).Cells(.Rows.Count,
"A").End(xlUp).Offset(1,0)

....but the copied rows are copied to the bottom of the destination sheet.

I want the copied rows to start at row 15 of the destination sheet, not the
bottom. I also want just the data copied. I do not want the copied rows to
wipe out my cell formatting on the destination sheet.

Thanks!


--- Posted via news://freenews.netfront.net/ - Complaints to ---

Jim Cone[_2_]

How do I copy several rows from one sheet to another?
 
ActQty.EntireRow.Copy
Sheets(1).Cells(15, 1).PasteSpecial Paste:=xlPasteValues
--
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(Data Options add-in: rows/dates/random stuff)





"Saucer Man"
wrote in message
...
I am currently doing...

ActQty.Entirerow.Copy Destination:=Sheets(1).Cells(.Rows.Count, "A").End(xlUp).Offset(1,0)

...but the copied rows are copied to the bottom of the destination sheet.

I want the copied rows to start at row 15 of the destination sheet, not the bottom. I also want
just the data copied. I do not want the copied rows to wipe out my cell formatting on the
destination sheet.

Thanks!

--- Posted via news://freenews.netfront.net/ - Complaints to ---




Saucer Man

How do I copy several rows from one sheet to another?
 
Great. If I put this in a loop, how do I make it so the next time through
the loop, the line is copied to row 16, etc.? I know I can replace the 15
with a variable and increment it but is there a easier way with a keyword?


"Jim Cone" wrote in message ...

ActQty.EntireRow.Copy
Sheets(1).Cells(15, 1).PasteSpecial Paste:=xlPasteValues
--
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(Data Options add-in: rows/dates/random stuff)


--- Posted via news://freenews.netfront.net/ - Complaints to ---

Jim Cone[_2_]

How do I copy several rows from one sheet to another?
 
Sheets(1).Rows("15:30").Value = ActQty.EntireRow.Value
--or--

Dim x as Long
For x = 15 to 30
ActQty.EntireRow.Copy
Sheets(1).Cells(x, 1).PasteSpecial Paste:=xlPasteValues
Next
--or--

ActQty.EntireRow.Copy
Sheets(1).Rows("15:30").PasteSpecial xlPasteValues
'----
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(List Files XL add-in: finds and lists files/folders with hyperlinks)




"Saucer Man"
wrote in message ...
Great. If I put this in a loop, how do I make it so the next time through the loop, the line is
copied to row 16, etc.? I know I can replace the 15 with a variable and increment it but is there
a easier way with a keyword?




"Jim Cone" wrote in message ...

ActQty.EntireRow.Copy
Sheets(1).Cells(15, 1).PasteSpecial Paste:=xlPasteValues
--
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(Data Options add-in: rows/dates/random stuff)




Saucer Man

How do I copy several rows from one sheet to another?
 
Thanks. The middle example is working best as the others just copy the same
line 15 times. However, I discovered that copying the entire row is wiping
out a formula in the sheet being copied to. How can I copy just columns 1
through 4?


"Jim Cone" wrote in message ...

Sheets(1).Rows("15:30").Value = ActQty.EntireRow.Value
--or--

Dim x as Long
For x = 15 to 30
ActQty.EntireRow.Copy
Sheets(1).Cells(x, 1).PasteSpecial Paste:=xlPasteValues
Next
--or--

ActQty.EntireRow.Copy
Sheets(1).Rows("15:30").PasteSpecial xlPasteValues
'----
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(List Files XL add-in: finds and lists files/folders with hyperlinks)


--- Posted via news://freenews.netfront.net/ - Complaints to ---

Jim Cone[_2_]

How do I copy several rows from one sheet to another?
 

Check out the Resize property in Excel VB help.
'---
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(XL Companion add-in: compares, matches, counts, lists, finds, deletes...)




"Saucer Man"
wrote in message ...
Thanks. The middle example is working best as the others just copy the same line 15 times.
However, I discovered that copying the entire row is wiping out a formula in the sheet being
copied to. How can I copy just columns 1 through 4?





"Jim Cone" wrote in message ...

Sheets(1).Rows("15:30").Value = ActQty.EntireRow.Value
--or--
Dim x as Long
For x = 15 to 30
ActQty.EntireRow.Copy
Sheets(1).Cells(x, 1).PasteSpecial Paste:=xlPasteValues
Next
--or--
ActQty.EntireRow.Copy
Sheets(1).Rows("15:30").PasteSpecial xlPasteValues
'----
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(List Files XL add-in: finds and lists files/folders with hyperlinks)




Saucer Man

How do I copy several rows from one sheet to another?
 
The Resize command worked great. Thanks Jim for all your help.


"Jim Cone" wrote in message ...


Check out the Resize property in Excel VB help.
'---
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(XL Companion add-in: compares, matches, counts, lists, finds, deletes...)

--- Posted via news://freenews.netfront.net/ - Complaints to ---


All times are GMT +1. The time now is 01:19 PM.

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