Help... repeating or loop...!?

MktVBA

New Member
Joined
Aug 12, 2011
Messages
13
I need help how I can loop or repeat the following code!?
That is if the If sentece triggers then I want the code to continue to execute. It can be either a loop which loops certain amounts of time or endless as far as the If sentence triggers. Thought of "For ...Next" not sure!

If Cells(25, 9) = "UP" Then
Application.EnableEvents = False

Range("K25:L25").Select
Selection.Copy
Range("M25:N25").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("L9").Select


Thanks

Bern
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
so the code you have would only loop the one time, so not really necessary. Explain exactly what you are trying to do and maybe it will be a little clearer to me (no promises, since it is Friday afternoon)
 
Upvote 0
It is a nested IF code if that changes in terms of where to put the loop around it.
In other words

IF Cells (2,3) = X Then
Code
........
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,719
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top