Sunday, April 20, 2008
Where Can Buy Cal Gel
The For Each .. Next repeat instructions for each of the objects in a collection
determined.
slightly modified previously seen an example of the colors of the book to
get the same result.
But this time we will refer to collections of objects. Sub
obtener_los_56_colores ()
'here is known that the Excel handles a palette of 56 colors
' then we know also that it is necessary to repeat a certain section
the code
rango_a_pintar As Range Dim cell As Range Dim
As Byte Dim
September
rango_a_pintar = Range ("A1: A56") 'assign the range we need
For Each cell In rango_a_pintar' repeated for one element of the collection
a = a + 1
celda.Interior.ColorIndex = a 'assigning respective colors of the book
cell Next cell End Sub
Do Herpes Outbreaks Become Worse With Age?
For Each .. Next Repetition Structure (For .. Next Loops)
For ... Next structures those used in the cases when s know how many times it is necessary to repeat certain instructions
ejecuion
Sub obtener_los_56_colores ()
'here known that Excel handles a palette of 56 colors
'then we know also that it is necessary to repeat a certain section of code
As Byte Dim
Range ("A1: A56").
Select For a = 1 To 56' repeat 56 times
Selection.Cells (a). Interior.color = ActiveWorkbook.Colors (a)
'book assign colors to the respective cell to
Next End Sub
For ... Next structures those used in the cases when s know how many times it is necessary to repeat certain instructions
ejecuion
Sub obtener_los_56_colores ()
'here known that Excel handles a palette of 56 colors
'then we know also that it is necessary to repeat a certain section of code
As Byte Dim
Range ("A1: A56").
Select For a = 1 To 56' repeat 56 times
Selection.Cells (a). Interior.color = ActiveWorkbook.Colors (a)
'book assign colors to the respective cell to
Next End Sub
I Get Thrush After Every Period
Repeating Structures
repetition structures are used to execute one or more instructions repeatedly
--------- Do ... Loop
allow us to execute a statement block for an unlimited number of times
* But while a condition is (TRUE) True or until you make real.
The sgte is an example of a macro that checks the condition is true at the beginning in order to continue with the repetitions
'first enter values \u200b\u200bin a column ... for example, A1 to A5
' now put yourself on cell A1 Sub
EJEMPLO_DO_LOOP () 'check condition at the beginning
' This macro adds the value of the variable "I"
'the value of each cell
' check the keyword While the condition is true '
and then continues execution
loop Dim I As Integer
Do While Not IsEmpty (Selection) 'continuran repeats as long as the selection' no 'is empty
I = I + 100
If IsNumeric (Selection) Then Selection.Value = Selection.Value + I
Selection.Offset (1, 0).
Select Loop End Sub
Sub EJEMPLO_DO_LOOP1 () ' final check
'This macro adds the value of the variable "I" to the value of each cell
' check the keyword While the condition is true but in the end is
'after you have run the loop at least once
Dim I As Integer Do
I = I + 100
If IsNumeric (Selection) Then Selection.Value = Selection.Value + I
Selection.Offset (1, 0).
Select Loop While Not IsEmpty (Selection) 'continuran repeats as long as the selection
' is not empty End Sub
repetition structures are used to execute one or more instructions repeatedly
--------- Do ... Loop
allow us to execute a statement block for an unlimited number of times
* But while a condition is (TRUE) True or until you make real.
The sgte is an example of a macro that checks the condition is true at the beginning in order to continue with the repetitions
'first enter values \u200b\u200bin a column ... for example, A1 to A5
' now put yourself on cell A1 Sub
EJEMPLO_DO_LOOP () 'check condition at the beginning
' This macro adds the value of the variable "I"
'the value of each cell
' check the keyword While the condition is true '
and then continues execution
loop Dim I As Integer
Do While Not IsEmpty (Selection) 'continuran repeats as long as the selection' no 'is empty
I = I + 100
If IsNumeric (Selection) Then Selection.Value = Selection.Value + I
Selection.Offset (1, 0).
Select Loop End Sub
Sub EJEMPLO_DO_LOOP1 () ' final check
'This macro adds the value of the variable "I" to the value of each cell
' check the keyword While the condition is true but in the end is
'after you have run the loop at least once
Dim I As Integer Do
I = I + 100
If IsNumeric (Selection) Then Selection.Value = Selection.Value + I
Selection.Offset (1, 0).
Select Loop While Not IsEmpty (Selection) 'continuran repeats as long as the selection
' is not empty End Sub
Subscribe to:
Posts (Atom)