Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop command in Macro
In Classical programming languages like Fortran and Basic we have a command
called: "Loop or Go to" which is used to run a series of commands in recurrence until a limit or satisfying a criteria. In Macro I want to do some commands on cells in a raw and continue same commands for second raw until I reach to last row. I think I am looking for some sort of equivalent of Loop in Macro. Could you please tell what it should be? or if the philosophy of doing such a recurring commands differ in Macro and I am thinking in a rong way in Macro TIA, Rasoul |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop command in Macro
Rasoul,
You can certainly loop in VBA. See the VBA help for Do While, Do Until, and For Next loops. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Rasoul Khoshravan Azar" wrote in message ... In Classical programming languages like Fortran and Basic we have a command called: "Loop or Go to" which is used to run a series of commands in recurrence until a limit or satisfying a criteria. In Macro I want to do some commands on cells in a raw and continue same commands for second raw until I reach to last row. I think I am looking for some sort of equivalent of Loop in Macro. Could you please tell what it should be? or if the philosophy of doing such a recurring commands differ in Macro and I am thinking in a rong way in Macro TIA, Rasoul |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop command in Macro
Rasoul
This code will look through column D until it runs out of rows with data. Uses Do/While Sub findthings() With ActiveSheet.Range("D:D") Set c = .Find("xx", LookIn:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do c.Interior.Pattern = xlPatternGray50 Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub Gord Dibben Excel MVP On Tue, 6 Jan 2004 00:41:50 +0330, "Rasoul Khoshravan Azar" wrote: In Classical programming languages like Fortran and Basic we have a command called: "Loop or Go to" which is used to run a series of commands in recurrence until a limit or satisfying a criteria. In Macro I want to do some commands on cells in a raw and continue same commands for second raw until I reach to last row. I think I am looking for some sort of equivalent of Loop in Macro. Could you please tell what it should be? or if the philosophy of doing such a recurring commands differ in Macro and I am thinking in a rong way in Macro TIA, Rasoul |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop command in Macro
There is also the For Each... Next loop. :)
One example would be: For Each vnt_Variable in Range("A1:A6000") If vnt_Variable.value = 1500 then vnt_Variable.value = "" End If Next vnt_Variable -Donna -----Original Message----- In Classical programming languages like Fortran and Basic we have a command called: "Loop or Go to" which is used to run a series of commands in recurrence until a limit or satisfying a criteria. In Macro I want to do some commands on cells in a raw and continue same commands for second raw until I reach to last row. I think I am looking for some sort of equivalent of Loop in Macro. Could you please tell what it should be? or if the philosophy of doing such a recurring commands differ in Macro and I am thinking in a rong way in Macro TIA, Rasoul . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
using a vlookup command in a for next loop in a macro in excel | Excel Discussion (Misc queries) | |||
macro loop | Excel Discussion (Misc queries) | |||
how can i loop a macro | Excel Discussion (Misc queries) | |||
Loop macro help. | Excel Programming |