Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simplify this into a loop
I have a formula that I have to copy 150 times. I know that there is a
simple way to convert it to a loop macro but I don't know how to do it. Can someone help me on this one??? this is the macro that I create and I have to do it from cell 16 to cell 166 so it will go 150 until it find a stop cell. Thanks. This is the macro: Sub SinglMixInfo_Button5_Click() Rows("13:150").Select Selection.Delete Shift:=xlUp Sheets("form").Select Range("B13:y17").Select Selection.Copy Sheets("Single & Mix Info").Select Range("B13").Select ActiveSheet.Paste Rows("15:15").Select Selection.Copy Rows("16:16").Select Selection.Insert Shift:=xlDown If Range("x16") = "stop" Then Range("16:16").Select Selection.Delete Exit Sub Else Rows("15:15").Select Selection.Copy Rows("17:17").Select Selection.Insert Shift:=xlDown If Range("x17") = "stop" Then Range("17:17").Select Selection.Delete Exit Sub Else Rows("15:15").Select Selection.Copy Rows("18:18").Select Selection.Insert Shift:=xlDown End If End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I need to simplify this... | Excel Worksheet Functions | |||
please help simplify | Excel Programming | |||
please help simplify | Excel Programming | |||
please help simplify | Excel Programming | |||
please help simplify | Excel Programming |