1.单元格取值赋值
Private Sub CommandButton1_Click()
Range("A1") = "111"
Range("A2").Value = "2222"
Range("A10") = Range("A1")
Range("A11") = Cells(2, 1).Value
Range("A12") = Cells(2, 1)
Range("A1") = "111"
Range("A2").Value = "2222"
Range("A10") = Range("A1")
Range("A11") = Cells(2, 1).Value
Range("A12") = Cells(2, 1)
Range("A13").ClearContents '清除内容
Range("a20").Formula = "=rand()" '单无格公式
2.单元格设置颜色
Cells(1, 1).Interior.ColorIndex = 3 '单无格的颜色