Create Table in Excel
Update which number table that you require to print in E3 cell.
Ex: If you want 5th table update with 5
Upto what what extent you require table, update in the cell of H3
Ex:I require upto 20., i.e 5*20
Private Sub CommandButton1_Click()
Dim j As Integer, i As Integer, Q As Integer, S As Integer
Range("D3").Value = "Table"
Range("D3").Font.Size = 18
Range("D3").Font.Bold = True
Range("G3").Value = "Upto"
Range("G3").Font.Size = 18
Range("G3").Font.Bold = True
Range("E3").Interior.ColorIndex = 3
Range("H3").Interior.ColorIndex = 3
j = Range("H3").Value
S = Range("E3").Value
Q = 5
For i = 1 To j
Cells(Q, 5) = S
Cells(Q, 6) = "x"
Cells(Q, 7) = i
Cells(Q, 8) = "="
Cells(Q, 9) = S * i
Q = Q + 1
Next
Dim r As Integer
r = Range(Range("E5"), Range("E5").End(xlDown)).Rows.Count
Range(Cells(5, 5), Cells((5 + r) - 1, 9)).Select
'Range(Cells(5, 5), Cells(Q, 9)).Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.Size = 15
.Font.Name = "Calibri"
.Font.ColorIndex = 9
End With
End Sub