ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   specifying ranges using cells (https://www.excelbanter.com/excel-programming/332171-specifying-ranges-using-cells.html)

Mitch

specifying ranges using cells
 
I need to copy a range of cells and paste the values into another worksheet
within a loop where the column part of the cell reference changes with each
loop iteration. For example, copy & paste the values from Worksheet One
cells B5 through B10 to Worksheet Two beginning at cell D7; then shift to C5
through C10 to cell E7, and etc. I have used both Range and Cells approaches
without success. Is there an easy way to do this?

Bob Phillips[_6_]

specifying ranges using cells
 

For i = 2 to 3
Cells(5,i).Resize(,6).Copy Worksheets("Sheet2").Cells(7,i+2)
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mitch" wrote in message
...
I need to copy a range of cells and paste the values into another

worksheet
within a loop where the column part of the cell reference changes with

each
loop iteration. For example, copy & paste the values from Worksheet One
cells B5 through B10 to Worksheet Two beginning at cell D7; then shift to

C5
through C10 to cell E7, and etc. I have used both Range and Cells

approaches
without success. Is there an easy way to do this?





All times are GMT +1. The time now is 11:28 AM.

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