Hi Marreco,
If you record a macro of adding borders to a range you will see the basic structure to do so. To prompt the user for a number-only Inputbox use:
ans = Application.InputBox("Enter a number", "Number here", , , , , , 1)
You'll then be able to adjust the code to add borders, e.g.
Sub addBorders()
Dim ans As Long
ans = Application.InputBox("How many rows to put border around?", "Add Borders", , , , , , 1)
With Range("A1:H" & ans)
.Borders.LineStyle = xlContinuous
.Borders.ColorIndex = 0
.Borders.TintAndShade = 0
.Borders.Weight = xlThin
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
End Sub
Bookmarks