vba 单元格 一系例操作
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 '单无格的颜色
Ewin:梦想可以到达的地方,网络就可以做到-开放、平等、自由、充满激情......