Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I use loops to enhance this code?
Can I use loops to enhance this code?
Sheet24.Cells(5, 2).Copy Destination:=Sheet5.Cells(10, 3) Sheet24.Cells(5, 3).Copy Destination:=Sheet5.Cells(10, 4) Sheet24.Cells(5, 4).Copy Destination:=Sheet5.Cells(11, 3) Sheet24.Cells(5, 5).Copy Destination:=Sheet5.Cells(11, 4) Sheet24.Cells(5, 6).Copy Destination:=Sheet5.Cells(12, 3) Sheet24.Cells(5, 7).Copy Destination:=Sheet5.Cells(12, 4) Sheet24.Cells(5, 8).Copy Destination:=Sheet5.Cells(13, 3) Sheet24.Cells(5, 9).Copy Destination:=Sheet5.Cells(13, 4) Sheet24.Cells(5, 10).Copy Destination:=Sheet5.Cells(14, 3) Sheet24.Cells(5, 11).Copy Destination:=Sheet5.Cells(14, 4) Sheet24.Cells(5, 12).Copy Destination:=Sheet5.Cells(15, 3) Sheet24.Cells(5, 13).Copy Destination:=Sheet5.Cells(15, 4) Sheet24.Cells(5, 14).Copy Destination:=Sheet5.Cells(16, 3) Sheet24.Cells(5, 15).Copy Destination:=Sheet5.Cells(16, 4) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I use loops to enhance this code?
Sub LoopEffect()
Dim Sheet24 As Worksheet, Sheet5 As Worksheet Dim i As Long, j As Long Set Sheet24 = Worksheets(2) Set Sheet5 = Worksheets(3) For i = 2 To 15 j = i Mod 2 Sheet5.Cells((9 + (i - j) / 2), j + 3) = Sheet24.Cells(5, i).Value Next i End Sub Pls check. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I use loops to enhance this code?
That worked perfectly - thank you very much!!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Enhance sumproduct to return unique employee code count | Excel Worksheet Functions | |||
help with loops in code, | Excel Programming | |||
code loops 1024 times not what i ask | Excel Programming | |||
ADO & Loops: error in code? | Excel Programming | |||
Help on writing code more efficiently (Loops) | Excel Programming |