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 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

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 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 +...

Function 合并(b As Range) Dim d Set d = CreateObject("Scripting.Dictionary") For Each c In b d(c.Value) = "" Next 合并 = Join(d.keys, "") Set d = Nothing End Function

前两天正好找到这样一段代码,借你用一下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...

Sub ShtAdd() On Error Resume Next MsgBox "下面将根据C列的班级名新建不同的工作表。" Dim i As Integer, sht As Worksheet arr = Range(Worksheets("成绩表").[c2], Worksheets("成绩表").Cells(Rows.Count, 3).End(3)) For i = 1 To UBound(...

Sub s() n = Cells(Rows.Count, 1).End(3).Row m = 5 k = [e1] If k < 3 Or k > n Then Exit Sub t = Cells(n, 1) + Cells(n - 1, 1) sm = t For i = 2 To k - 1 tt = Cells(n - i, 1) If tt > t - 3 And tt < t + 3 Or t < 2 And tt > t + 7 Or...

dim arr,i arr=array(1,2,45,7,8) 用FOR EACH的语句是: for each i in arr .....' msgbox i next i 使用for语句的写法是: for i=lbound(arr) to ubound(arr) ......'msgbox arr(i) next i

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