|
- Sub 合并3个工作表()
- '
- ' 合并
- '
- '
- Sheets("公司1").Select
- Application.Goto Reference:="R2:R65536"
- Selection.SpecialCells(xlCellTypeConstants, 23).Select
- Selection.Copy
- Sheets("合并").Select
- Columns("A:A").Select
- Selection.SpecialCells(xlCellTypeBlanks).Select
- ActiveCell.Select
- ActiveSheet.Paste
- Sheets("公司2").Select
- Application.Goto Reference:="R2:R65536"
- Selection.SpecialCells(xlCellTypeConstants, 23).Select
- Application.CutCopyMode = False
- Selection.Copy
- Sheets("合并").Select
- Columns("A:A").Select
- Selection.SpecialCells(xlCellTypeBlanks).Select
- ActiveCell.Select
- ActiveSheet.Paste
- Sheets("公司3").Select
- Application.Goto Reference:="R2:R65536"
- Selection.SpecialCells(xlCellTypeConstants, 23).Select
- Application.CutCopyMode = False
- Selection.Copy
- Sheets("合并").Select
- Columns("A:A").Select
- Selection.SpecialCells(xlCellTypeBlanks).Select
- ActiveCell.Select
- ActiveSheet.Paste
- Columns("B:B").Select
- Application.CutCopyMode = False
- ActiveWorkbook.Worksheets("合并").Sort.SortFields.Clear
- ActiveWorkbook.Worksheets("合并").Sort.SortFields.Add Key:=Range("B1"), SortOn _
- :=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
- With ActiveWorkbook.Worksheets("合并").Sort
- .SetRange Range("A2:D98")
- .Header = xlNo
- .MatchCase = False
- .Orientation = xlTopToBottom
- .SortMethod = xlPinYin
- .Apply
- End With
- End Sub
复制代码 我的是用的,定位功能和相对引用功能,录制时比较繁琐,我会录制但是看不懂代码, |
|