I need some help creating a simple macro that will generate a grid of simple artistic text elements containing sequential numbers (grid happens to be 22x14 places). My only experience thus far has been with manually cleaning up recorded macros.
My limited experience tells me I will need an iterated variable and 2 nested loops (for loops i think?) to create the grid, but I don't know how to create each text element.
Could you please help me with this seemingly simple macro?
Thanks!
Followng code creates matrix of 22 x14 (horizontally x vertically) grid of sequnetial numbers with possibility to enter starting value
Sub GridOfNumbers() Dim s1 As Shape, startnum As Integer, i As Integer, ix As Integer, ti As Integer ActiveDocument.Unit = cdrMillimeter startnum = InputBox("Enter starting number") ActiveDocument.BeginCommandGroup ("numbers") Optimization = True ti = startnum For i = startnum To (startnum + 13) For ix = startnum To (startnum + 21) Set s1 = ActiveLayer.CreateArtisticText(0 + x, 290 + y, ti) s1.Fill.UniformColor.CMYKAssign 0, 0, 0, 100 s1.Outline.SetNoOutline x = x + 20 ti = ti + 1 Next ix x = 0 y = y - 20 Next i Optimization = False ActiveWindow.Refresh ActiveDocument.EndCommandGroupEnd Sub
Here you are
Sub GridOfNumbers2() Dim s1 As Shape, startnum As Integer, i As Integer, ix As Integer, ti As Integer ActiveDocument.Unit = cdrMillimeter startnum = InputBox("Enter starting number") ActiveDocument.BeginCommandGroup ("numbers") Optimization = True ti = startnum For i = startnum To (startnum + 13) For ix = startnum To (startnum + 21) Set s1 = ActiveLayer.CreateArtisticText(0 + x, 290 + y, Format(ti, "000")) s1.Fill.UniformColor.CMYKAssign 0, 0, 0, 100 s1.Outline.SetNoOutline x = x + 20 ti = ti + 1 Next ix x = 0 y = y - 20 Next i Optimization = False ActiveWindow.RefreshEnd Sub