问题:提取check之后的数字 来源:Excelhome Sub 提取数字() Dim regexp As New regexp With regexp .Pattern = "check\s*(\d+)" End With With Worksheets("sheet1") r = .Cells(.Rows.Count, 1).End(xlUp).Row arr = .Range("a1:b" & r) For i = 1 To UBo
作者:iamlaosong 将工作表中的数据赋给数组或者将数组的数据赋给工作表,一般有两种.一种是循环的方法,一个一个的传,这样的方法一般用于须要对每一个数据特别处理的场合,还有一种是一次性用赋值语句传,就速度来说,另外一种方法要快得多.看以下例程: Sub tt() Dim arr1(240000, 4) Dim arr2() lineno = [A1048576].End(xlUp).Row '行数 '循环给数组赋值.数组myarr必须先定
要求:若A列满足值为c,则将b列对应的内容背景色调为红色,并提取出来: 代码如下: Sub naqu()Dim i As IntegerFor i = 2 To Range("a65536").End(xlUp).Row If Cells(i, 1) = "c" Then n = n + 1 Cells(i, 2).Interior.Color = 666 Cells(n, 3) = Cells(i, 2) End IfNext End Sub