Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
basically
i want the macro to enter values 1 to 5 for range g2:g6 then move onto row h2:h6 and start with 2 and place i and the bottom so it should look like this Column G Column h Column i 1 2 3 2 3 4 3 4 5 4 5 1 5 1 2 which then i can create a bigger range from G to P can you help, i just can't work it out i've got 1 to 5 in every row but its not what i want |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
This should do it: Sub aaa() Dim StartCell As Range Set StartCell = Range("G2") For col = 0 To 9 MyVal = MyVal + 1 If MyVal 5 Then MyVal = 1 For r = 1 To 5 StartCell.Offset(r, col) = MyVal MyVal = MyVal + 1 If MyVal 5 Then MyVal = 1 Next Next End Sub Regards, Per "Alan" skrev i meddelelsen ... basically i want the macro to enter values 1 to 5 for range g2:g6 then move onto row h2:h6 and start with 2 and place i and the bottom so it should look like this Column G Column h Column i 1 2 3 2 3 4 3 4 5 4 5 1 5 1 2 which then i can create a bigger range from G to P can you help, i just can't work it out i've got 1 to 5 in every row but its not what i want |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simple formula needed | Excel Discussion (Misc queries) | |||
I need a simple loop with a 4+ row added in. | Excel Discussion (Misc queries) | |||
Another simple formula needed | Excel Worksheet Functions | |||
Help needed in a simple task | Excel Discussion (Misc queries) | |||
simple (i think) UDF debug help needed | Excel Discussion (Misc queries) |