V
Victor Torres
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
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