Professional Documents
Culture Documents
Range("A1").Value = "Hello"
Add formula
Range("D4").Formula = "=B3*10"
Range("D4").FormulaR1C1 = "=R3C2*10"
- Explanation: cell D4 references cell B3 (row 3, column 2). This is an absolute
reference ($ symbol in front of the row number and column letter
Range("D4").FormulaR1C1 = "=R[-1]C[-2]*10"
- Explanation: cell D4 references cell B3 (one row above and 2 columns to the
left). This is a relative reference. This code line gives the exact same result as the
code line used at step 1.
Prompt msg box:
MsgBox "this is fun"
//Action
If answer = vbYes Then
Cells.ClearContents
Else
'do nothing
End If