it is something like this:
Sub Surfaces()
Dim rTopLeft As Range
Dim Dia(1 To 4) As Double
Dim tk(1 To 3) As Double
Set rTopLeft = Worksheets("Sheet1").Range("B1")
'array dia.
Dia(1) = 21
Dia(2) = 28
Dia(3) = 34
Dia(4) = 40
'array tk
tk(1) = 1.2
tk(2) = 1.4
tk(3) = 1.8
'Write the table
With rTopLeft
.Offset(0, 1).Resize(1, UBound(Dia)).Value = Dia
.Offset(1, 0).Resize(UBound(tk), 1).Value = Application.Transpose(tk)
With .Offset(1, 1).Resize(UBound(tk), UBound(Dia))
.FormulaR1C1 = "=2*PI()/1000*r" & rTopLeft.Row & "c*rc" & rTopLeft.Column
.Value = .Value
.NumberFormat = "0.00"
End With
End With
End Sub
but now, I do not know how to sum some dates from an text_boxes to the previews code
code to add and to be summed
Private Sub CommandButton1_Click()
Dim Formula As Double
Dim i As Long
For i = 31 To 40
If Me.Controls("CheckBox" & i - 30) = True Then
If Me.Controls("TextBox" & i).Text = "" Then Me.Controls("TextBox" & i).Text = 0
Formula = Formula + CDbl(Me.Controls("TextBox" & i).Text)
End If
Next
Sheet1.Range("C2:W10").Value = Formula
End Sub
any idea will be great.thx