当前位置:首页 > Excel鑷紪瀹忓ぇ鍏?Word鐗? - 鐧惧害鏂囧簱
Range(\ Selection.Copy Sht2.Range(\ Application.CutCopyMode = False Sht1.Activate
pp = Sht1.Range(\ '将行数赋给变量pp Range(Cells(pp, 7), Cells(pp + aa - 1, 7)).Select
Selection.Copy Sht2.Range(\ '时间复制到表2 Sht2.Activate Cells(2, 3).Select
Selection.Formula = \ '时间值公式 If aa > 1 Then
Selection.AutoFill Destination:=Range(\ '公式往下复制
Range(\
Selection.Sort Key1:=Range(\ OrderCustom:=2, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _ :=xlPinYin Else End If
pp1 = Range(\ Sheets(2).Select For xx = 1 To 7
Cells(x, xx) = Sht1.Cells(pp1, xx) Next xx nn = aa
Sht1.Activate
Range(\ '清除辅助列数据 Sht2.Activate
Range(Cells(1, 1), Cells(aa + 1, 3)).ClearContents 200: Next x Sht1.Activate
Range(\
Selection.CurrentRegion.ClearContents '清除辅助列数据 Sheets(2).Activate
Range(\ ?排序
Selection.Sort Key1:=Range(\
OrderCustom:=2, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _ :=xlPinYin
加边框 '转加边框宏
Range(\
Application.ScreenUpdating = True
End Sub
Sub BcfzGS() '不重复值公式
Range(\ '辅助列公式求有几个不重复值 Selection.FormulaArray = \
Selection.AutoFill Destination:=rng1, Type:=xlFillDefault '公式往下复制 b = Application.WorksheetFunction.CountIf(rng1, \End Sub
Sub FuzulieGS()
'某个不重复值的个数和所在行数的数组公式 Sht1.Select
Set a = Range(\
aa = Application.WorksheetFunction.CountIf(minc, a) '计算某个不重复值的个数 Range(\ nn = aa
Range(\
Range(\ '某个不重复值所在行数的数组公式 Selection.FormulaArray = \$1,row(minc),\ If aa > 1 Then
Selection.AutoFill Destination:=Range(\ Else End If End Sub
Sub 加边框()
BorderVars(1) = xlEdgeLeft BorderVars(2) = xlEdgeTop BorderVars(3) = xlEdgeBottom BorderVars(4) = xlEdgeRight BorderVars(5) = xlInsideVertical BorderVars(6) = xlInsideHorizontal Range(\
Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone
For x = 1 To 6
With Selection.Borders(BorderVars(x)) .LineStyle = xlContinuous .Weight = xlThin
.ColorIndex = xlAutomatic End With Next End Sub
Sub zhytjl0215()
'最后一条记录0215.xls '蓝桥玄霜, '2007-2-15
'根据czzqbμ的数组公式修改 '在表1的H列加了时间转换公式
Dim b As Integer, x As Integer, y As Integer Dim minc As Range
Dim rng1 As Range, a As Range Dim Myrow1 As Integer
Dim Sht1 As Worksheet, Sht2 As Worksheet Dim BorderVars(6) As Variant
On Error Resume Next
Application.ScreenUpdating = False
Set Sht1 = Sheets(1): Set Sht2 = Sheets(2) Sht1.Activate ?定义动态区域名称
ActiveWorkbook.Names.Add Name:=\
\ ActiveWorkbook.Names.Add Name:=\
\
Range(\
Selection.CurrentRegion.ClearContents Sheet2.Activate Range(\
Selection.CurrentRegion.ClearContents Sht1.Range(\ Sht1.Activate
Range(\
Myrow1 = Selection.CurrentRegion.Rows.Count Set minc = Range(\
Set rng1 = Range(\
Range(\ '?'辅助列公式求不重复值 Selection.FormulaArray = \ Selection.AutoFill Destination:=rng1, Type:=xlFillDefault
?不重复值的个数
b = Application.WorksheetFunction.CountIf(rng1, \ Range(\ Selection.Copy
Selection.PasteSpecial Paste:=xlValues
Range(Cells(2, 14), Cells(1 + b, 14)).Copy Sht2.Cells(2, 1) Sht2.Activate Sht2.[b2].Select
Selection.FormulaR1C1 = \ Sht2.[c2].Select
Selection.Formula = \ Sht2.[d2].Select
Selection.Formula = \ Sht2.[e2].Select
Selection.Formula = \ Sht2.[f2].Select
Selection.Formula = \ Sht2.[g2].Select
Selection.FormulaArray = \ ?求时间最后的数组公式,by:czzqb
Range(\
Selection.AutoFill Destination:=Range(\
Sheets(2).Activate
Range(\ ?排序
Selection.Sort Key1:=Range(\
OrderCustom:=2, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _ :=xlPinYin
Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone ?加边框
BorderVars(1) = xlEdgeLeft BorderVars(2) = xlEdgeTop BorderVars(3) = xlEdgeBottom BorderVars(4) = xlEdgeRight BorderVars(5) = xlInsideVertical BorderVars(6) = xlInsideHorizontal
共分享92篇相关文档