How to repeat a macro a certain number of times in Word 2010?

I have a macro to create a table and then add a couple of blank lines below it.
How would I adjust the macro to ask how many times it should be repeated and then it repeated that many times?

Here is the macro:
Sub CreateTable()
' CreateTable Macro
    ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=8, NumColumns:= _
        4, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
    With Selection.Tables(1)
        If .Style <> "Table Grid" Then
            .Style = "Table Grid"
        End If
        .ApplyStyleHeadingRows = True
        .ApplyStyleLastRow = False
        .ApplyStyleFirstColumn = True
        .ApplyStyleLastColumn = False
        .ApplyStyleRowBands = True
        .ApplyStyleColumnBands = False
    End With
    Selection.EndKey Unit:=wdLine
    Selection.MoveDown Unit:=wdLine, Count:=2
    Selection.EndKey Unit:=wdStory
End Sub
Alex CampbellAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sub repeatN()
dim i as integer
For i = 1 to cint(inputbox "", "", "")
call CreateTable
next i
End Sub
I didn't test it - but input box will let you specify a prompt and title, and is a string.  The cInt (<string>)  part converts the string to an Integer.  It's not a very good solution but hope it helps.
Alex CampbellAuthor Commented:
Tried macro, but got error:  Compile Error: Syntax Error

Sub repeatN()
Dim i As Integer
For i = 1 To CInt(InputBox("", "", ""))
Call CreateTable
Next i
End Sub

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alex CampbellAuthor Commented:
Works great. Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.