ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Increasing columns (https://www.excelbanter.com/excel-discussion-misc-queries/229989-increasing-columns.html)

JTWarthogs

Increasing columns
 
If the code

row= 10
For i = 1 to 5
row= row+1
Worksheets("73").Range("b" & row).Copy Destination:=Worksheets("73-1
Data").Range(("b" & row)
next i

lets me take and copy b11, b12, b13, b14, b15

So how can I take the column and move it. Lets say that in the above I want
to move the copy to destination to change from a, b, c, d, e

row = 10
column = a
For i = 1 to 5
row= row+1
column = column + 1(???not really 1 so how do I do it????)
Worksheets("73").Range("b" & row).Copy Destination:=Worksheets("73-1
Data").Range((column & row)
next i

Thanks



JLatham

Increasing columns
 

Dim rowLoopCounter As Integer
Dim coloopCounter As Integer

For rowLoopCounter = 10 to 15
For colLoopCounter = 1 to 5 ' a=1, b=2...e=5
Worksheets("73").Cells(rowLoopCounter, colLoopCounter).Copy _
Destination:=Worksheets("73-1 Data").Cells(rowLoopCounter, colLoopCounter)
next ' move to next column
Next ' move to next row

I think maybe that'll get you going. At least I hope it does.

Although maybe you want to leave the range to be copied as "B" &
rowLoopCounter - I wasn't real sure from what you showed.


"JTWarthogs" wrote:

If the code

row= 10
For i = 1 to 5
row= row+1
Worksheets("73").Range("b" & row).Copy Destination:=Worksheets("73-1
Data").Range(("b" & row)
next i

lets me take and copy b11, b12, b13, b14, b15

So how can I take the column and move it. Lets say that in the above I want
to move the copy to destination to change from a, b, c, d, e

row = 10
column = a
For i = 1 to 5
row= row+1
column = column + 1(???not really 1 so how do I do it????)
Worksheets("73").Range("b" & row).Copy Destination:=Worksheets("73-1
Data").Range((column & row)
next i

Thanks




All times are GMT +1. The time now is 05:30 AM.

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