tnfh.net
当前位置:首页 >> VBA改写数组likE方法 >>

VBA改写数组likE方法

Sub 改写数组like方法()Dim arr, S$arr = Split([a1], ",")S = arr(0)For i = 1 To UBound(arr) If S Like "*" & arr(i) & "*" Then GoTo 1 S = S & "," & arr(i)1:Next[a3] = SEnd Sub

Sub 汇总()Application.ScreenUpdating = flaseDim I%, H%, L%, k%, arr, brrk = Sheets("原表").Range("a65536").End(xlUp).Rowarr = Sheets("原表").Range("a1:d" & k)ReDim brr(1 To k, 1 To 10)H = 1 For I = 1 To k If arr(I, 1) Like "*办...

Sub lqxs()Dim arr, i&, j&Sheet1.Activatearr = [e8:e13]For i = 1 To UBound(arr) For j = 1 To UBound(arr) If i j And arr(j, 1) = arr(i, 1) Then Exit For End If Next If j = UBound(arr) + 1 Then [g13] = "0次": Exit SubNext[g13] = U...

Sub test()Dim SArr1, SArr2, Tarr(), i%, j%, n%SArr2 = [k10:aq10]n = [c11].End(xlDown).Row - 10SArr1 = [c11].Resize(n, 6)ReDim Tarr(1 To n, 1 To 33)For i = 1 To n For j = 1 To 33 For k = 1 To 6 If SArr1(i, k) = j Then Tarr(i, j)...

Sub FenLei() MsgBox "下面将把成绩表分按班级分到各个工作表中!" Dim i As Long, j As Long, n As Long, arr arr = Sheets("成绩表").[a1].CurrentRegion For i = 2 To UBound(arr) n = Worksheets(arr(i, 3)).Range("A65536").End(xlUp).Row +...

Sub s() sn = [l1] en = [n1] stp = [t1] arr = [a2].CurrentRegion cc = 1 i = 1 Do Until arr(i, 1) = sn i = i + 1 Loop sl = i Do Until arr(i, 1) = en i = i + 1 If i = UBound(arr) Then Exit Do Loop el = i ReDim brr(sl To el, 1 To 3...

Sub A列没有重复数字和A列只有一个最接近99数字() Dim arr, t(10) arr = Range("a1").CurrentRegion x = Abs(arr(1, 1) - 99): t(1) = 1: k = 1 For i = 2 To UBound(arr) y = Abs(arr(i, 1) - 99) If x > y Then k = 1: t(1) = i: x = y ElseIf...

Private Sub Worksheet_Change(ByVal Target As Range)Dim changerow As LongDim i As LongDim wt As WorksheetDim arrDim sum As Doublechangerow = Target.RowIf changerow > 1 ThenSet wt = Worksheets("sheet1")sum = 0arr = wt.Cells(chang...

Sub Cc() T = Timer Dim x As Integer For x = 1 To Range("a65536").End(xlUp).Row Cells(x, 3) = Cells(x, 1) * Cells(x, 2) Next MsgBox Timer - T End Sub

前两天正好找到这样一段代码,借你用一下Dim arr, brr, crr(1 To 70), b As Boolean b = False Dim x%: x = 1 arr = ActiveSheet.Range(Cells(1, 1), Cells(70, 1)) brr = ActiveSheet.Range(Cells(1, 2), Cells(70, 2)) For i = 1 To UBound(ar...

网站首页 | 网站地图
All rights reserved Powered by www.tnfh.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com