一、给活动的单元格赋值
Range(“A1”).setect 选中A1
ActiveCell.formulaR1C1=“Name” 赋值 name
二、插入单元格
selection.Insert shift:=<xldirection>
selection.EntireRow.insert 当前行上插入一行
selection.EntireColumn.insert 当前单元格左侧插入一列
selection.Insert shift:=xlToright 当前单元格位置插入单元格,并将当前选中的单元格向右移动
selection.Insert shift:=xlDown 当前单元格位置插入单元格,并将当前选中的单元格向下
三、清空选中单元格里的内容
selection.clearcontents
例: Range("A!:A2,B7,2:2").select
selection.clearcontents
四、删除选中的单元格
Selection.Delete<xldirection>
Selection.entireRow.Delete 删除整行
Selection.entirecolumn.Delete 删除整列
例:selection.Delete Shift=xltoleft 删除单元格,右侧单元格左移
Selection.delete Shift =xlup 删除单元格,下面单元格上移
移动
/<xldirection>