Create a loop from cell A2 to A30 that fills cells with "SuperVBA". Also, have each iteration (repeat) increase by one the number of spaces between "Super" and "VBA".
Remember that in most cases there is more than one way to solve the exercise.
Hint: Remember that & is the string concatenation operator.
Declare a variable for the loop counter and one to store the spaces that will be accumulated by iteration
Dim i As Integer Dim space As String space = ""
Create the loop with For Next assigning to each iteration text to cell and a space to variable that accumulates spaces
For i = 2 To 30 Cells(i, 1).Value = "Super" & space & "VBA" space = space & " " Next i
Sub Solution() Dim i As Integer Dim space As String space = "" For i = 2 To 30 Cells(i, 1).Value = "Super" & space & "VBA" space = space & " " Next i End Sub
SuperExcelVBA.com is learning website. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. All Rights Reserved.
Excel ® is a registered trademark of the Microsoft Corporation.
© 2021 SuperExcelVBA | ABOUT