Body Mass Index 
///////////////////////////
 Write an R function to calculate the BMI (Body Mass Index) 
    which is defined as Weight in Kg divided by the squared 
    height (in meter). 

               W       kg
    BMI =    ------  = ----
              H^2      m^2

  There are two types of inputs: 
       1) Kg and m directly, and 
       2) foot (or inche) and pound.

  1 inch = 0.0254 m
  1 pound = 0.45359237 kg

   http://datayyy.com/webs/bmi.html
   http://datayyy.com/webs/bmi2.html

///////////////////////////

Macro 4 generating five 9
/////////////////////////

Sub tt()
   Dim i As Integer
   For i = 1 To 5
       Cells(i, 1).Value = 9
   Next i
End Sub


/////////////////////////

Macro for doube loops
/////////////////////////

Sub tt()

   Dim i As Integer, j As Integer
   For i = 1 To 7
       For j = 1 To 2
           Cells(i, j).Value = 8
       Next j
   Next i

End Sub

/////////////////////////

Macro for double loops
/////////////////////////
enter three values in A1, A2, and A3, e.g., 
5
4
90


Sub tt()
    Dim i As Integer, j As Integer, x As Integer
    i = Range("A1").Value
    j = Range("A2").Value
    x = Range("A3").Value
    Cells(i, j).Value = x
    
End Sub

/////////////////////////

Message box:mutiple lines 
/////////////////////////

Sub getVarCovMatrixHelp()

Dim t1 As String
Dim t2 As String
Dim t3 As String
Dim t4 As String
Dim t5 As String

t1 = "1) Assume: exists a return matrix (n by k)"
t2 = "2) Name it as retMatrix"
t3 = "    note: if the name of retMatrix exists, then delete it"
t4 = "3) Select k by k cells"
t5 = "4) Click getVarCovMatrix"

    MsgBox (t1 & vbCrLf & t2 & vbCrLf & t3 & vbCrLf & t4 & vbCrLf & t5)
    
End Sub

/////////////////////////

Macro for printing your instruction 
/////////////////////////

Sub printInstruction()

Dim t1 As String
Dim t2 As String
Dim t3 As String
Dim t4 As String
Dim t5 As String

t1 = "1) Assume: exists a return matrix (n by k)"
t2 = "2) Name it as retMatrix"
t3 = "    note: if the name of retMatrix exists, then delete it"
t4 = "3) Select k by k cells"
t5 = "4) Click getVarCovMatrix"

    ActiveCell.FormulaR1C1 = t1
    ActiveCell.Offset(1, 0).Select
    ActiveCell.FormulaR1C1 = t2
    ActiveCell.Offset(1, 0).Select
    ActiveCell.FormulaR1C1 = t3
    ActiveCell.Offset(1, 0).Select
    ActiveCell.FormulaR1C1 = t4
    ActiveCell.Offset(1, 0).Select
    ActiveCell.FormulaR1C1 = t5
    ActiveCell.Offset(1, 0).Select
    
   
End Sub

/////////////////////////