Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need to simplify this... j5b9721 Excel Worksheet Functions 5 July 23rd 09 09:03 AM
please help simplify acarril[_12_] Excel Programming 0 September 27th 04 07:45 PM
please help simplify acarril[_11_] Excel Programming 1 September 27th 04 04:45 PM
please help simplify acarril[_10_] Excel Programming 1 September 21st 04 07:39 PM
please help simplify acarril[_9_] Excel Programming 1 September 21st 04 05:36 PM


All times are GMT +1. The time now is 02:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"