ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying a range (https://www.excelbanter.com/excel-programming/400248-copying-range.html)

Francis Hookham

Copying a range
 
This works
Sheets("Pages").Cells(iCPaRow, 1) =
Sheets("Specs").Cells(iCSpRow, 1)
Sheets("Pages").Cells(iCPaRow, 2) =
Sheets("Specs").Cells(iCSpRow, 2)
Sheets("Pages").Cells(iCPaRow, 3) =
Sheets("Specs").Cells(iCSpRow, 3)
Sheets("Pages").Cells(iCPaRow, 4) =
Sheets("Specs").Cells(iCSpRow, 4)

This does not work
Sheets("Pages").Range(Cells(iCPaRow, 1), Cells(iCPaRow, 4)) = _
Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow, 4))

This works but copies formatting as well as values - I only want values
Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow, 4)).Copy
_
Destination:=Worksheets("Pages").Cells(iCPaRow, 1)

This does not work
Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow,
4)).Copy.Values _
Destination:=Worksheets("Pages").Cells(iCPaRow, 1)


Please help.


Francis Hookham
XL 2002



joel

Copying a range
 
Try pastespecial. below there are two seperate instruction. the first is
the Copy and the ssecond is the paste.

Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow, 4)).Copy
Worksheets("Pages").Cells(iCPaRow, 1).PasteSpecial _
Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False


"Francis Hookham" wrote:

This works
Sheets("Pages").Cells(iCPaRow, 1) =
Sheets("Specs").Cells(iCSpRow, 1)
Sheets("Pages").Cells(iCPaRow, 2) =
Sheets("Specs").Cells(iCSpRow, 2)
Sheets("Pages").Cells(iCPaRow, 3) =
Sheets("Specs").Cells(iCSpRow, 3)
Sheets("Pages").Cells(iCPaRow, 4) =
Sheets("Specs").Cells(iCSpRow, 4)

This does not work
Sheets("Pages").Range(Cells(iCPaRow, 1), Cells(iCPaRow, 4)) = _
Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow, 4))

This works but copies formatting as well as values - I only want values
Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow, 4)).Copy
_
Destination:=Worksheets("Pages").Cells(iCPaRow, 1)

This does not work
Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow,
4)).Copy.Values _
Destination:=Worksheets("Pages").Cells(iCPaRow, 1)


Please help.


Francis Hookham
XL 2002




Francis Hookham

Copying a range
 
Thanks a million Joel

Francis

"Joel" wrote in message
...
Try pastespecial. below there are two seperate instruction. the first is
the Copy and the ssecond is the paste.

Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow, 4)).Copy
Worksheets("Pages").Cells(iCPaRow, 1).PasteSpecial _
Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False


"Francis Hookham" wrote:

This works
Sheets("Pages").Cells(iCPaRow, 1) =
Sheets("Specs").Cells(iCSpRow, 1)
Sheets("Pages").Cells(iCPaRow, 2) =
Sheets("Specs").Cells(iCSpRow, 2)
Sheets("Pages").Cells(iCPaRow, 3) =
Sheets("Specs").Cells(iCSpRow, 3)
Sheets("Pages").Cells(iCPaRow, 4) =
Sheets("Specs").Cells(iCSpRow, 4)

This does not work
Sheets("Pages").Range(Cells(iCPaRow, 1), Cells(iCPaRow, 4)) =
_
Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow,
4))

This works but copies formatting as well as values - I only want values
Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow,
4)).Copy
_
Destination:=Worksheets("Pages").Cells(iCPaRow, 1)

This does not work
Sheets("Specs").Range(Cells(iCSpRow, 1), Cells(iCSpRow,
4)).Copy.Values _
Destination:=Worksheets("Pages").Cells(iCPaRow, 1)


Please help.


Francis Hookham
XL 2002







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

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