Sub W() ' MsgBox "行数:" & Selection.Rows.Count Dim rows_count As Integer Dim rows_id As Integer Dim column_count As Integer column_count = Selection.Columns.Count '获取选择区域的列数 'MsgBox column_count '打印列数 rows_id = ActiveCell.
若EXCEL工作表有很多合并的单元格,要将所有合并的单元格撤销,并填充撤销合并前显示的内容,这是一项很繁琐且容易出错的工作.但可通过宏程序可轻松准确地搞定,方法如下: 一.实现该功能的Excel宏程序(复制即可) Private Sub CXHB()Dim i As RangeFor Each i In ActiveSheet.UsedRangeIf i.Address <> i.MergeArea.Address And i.Address = i.MergeArea.Item(1).Add