Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Column and row advance
I asked this earlier but it may not have been clear. To advance the rows in
a for statement is easy. So in the case below it is checking from A1 to A31 for the date and when it matches it copies over to the B and C columns. So how do you check from columns B, C, D, E, and F? so I could do another For/next statement inside to go from B to F so let column=a, then column = column + ???? so that it goes to B, then cycles through the loop and goes to C and so on until it cycles through 5 times 9 from B to F. I know that the +1 does not work so how can you cycle through letters? Dim i As Integer Let i = 1 For i = 1 To 31 If datecurrent = Worksheets("73-1 Data").Range("a" & i) Then Worksheets("73").Range("b40").Copy Destination:=Worksheets("73-1 Data").Range("b" & i) Worksheets("73").Range("b41").Copy Destination:=Worksheets("73-1 Data").Range("c" & i) Worksheets("73").Range("b42").Copy Destination:=Worksheets("73-1 Data").Range("d" & i) Worksheets("73").Range("b43").Copy Destination:=Worksheets("73-1 Data").Range("e" & i) Worksheets("73").Range("b44").Copy Destination:=Worksheets("73-1 Data").Range("f" & i) Endif Next i Dim i As Integer Let i = 1 For i = 1 To 31 If datecurrent = Worksheets("73-1 Data").Range("a" & i) Then For column = 1 to 5 Worksheets("73").Range("b40").Copy Destination:=Worksheets("73-1 Data").Range(column & i) column = column +1 Next column Endif Next i |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Column and row advance
I got it
Let i = 1 For i = 1 To 31 If datecurrent = Worksheets("73-1 Data").Range("a" & i) Then For column = 2 To 6 Worksheets("73").Range("b40").Copy Destination:=Worksheets("73-1 Data").Cells(i, column) Next column Endif Next i "JTWarthogs" wrote: I asked this earlier but it may not have been clear. To advance the rows in a for statement is easy. So in the case below it is checking from A1 to A31 for the date and when it matches it copies over to the B and C columns. So how do you check from columns B, C, D, E, and F? so I could do another For/next statement inside to go from B to F so let column=a, then column = column + ???? so that it goes to B, then cycles through the loop and goes to C and so on until it cycles through 5 times 9 from B to F. I know that the +1 does not work so how can you cycle through letters? Dim i As Integer Let i = 1 For i = 1 To 31 If datecurrent = Worksheets("73-1 Data").Range("a" & i) Then Worksheets("73").Range("b40").Copy Destination:=Worksheets("73-1 Data").Range("b" & i) Worksheets("73").Range("b41").Copy Destination:=Worksheets("73-1 Data").Range("c" & i) Worksheets("73").Range("b42").Copy Destination:=Worksheets("73-1 Data").Range("d" & i) Worksheets("73").Range("b43").Copy Destination:=Worksheets("73-1 Data").Range("e" & i) Worksheets("73").Range("b44").Copy Destination:=Worksheets("73-1 Data").Range("f" & i) Endif Next i Dim i As Integer Let i = 1 For i = 1 To 31 If datecurrent = Worksheets("73-1 Data").Range("a" & i) Then For column = 1 to 5 Worksheets("73").Range("b40").Copy Destination:=Worksheets("73-1 Data").Range(column & i) column = column +1 Next column Endif Next i |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
An Advance IF | Excel Worksheet Functions | |||
A Year in advance ? | Excel Worksheet Functions | |||
advance filtering | Excel Discussion (Misc queries) | |||
I need a little help...thanks in advance | Excel Discussion (Misc queries) | |||
Here's one for you...(thanks for the help in advance) | Excel Discussion (Misc queries) |