Range("A1").Select Selection.Copy Cells.Find(What:="*照明*", After:=ActiveCell, LookIn:=xlFormulas, LookAt _:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _False, MatchByte:=False, SearchFormat:=False).Activate Cells.FindNext(After:=ActiveCell).Activate ...
Sub fdSpace() Dim UR As Range, Rng As Range, sA As String Set UR = Worksheets(1).UsedRange Set Rng = UR.Find(" ", , xlValues, xlPart) sA = Rng.Address Do Set Rng = UR.FindNext(Rng) Debug.Print Rng.Address Loop Until Rng.Address = sA En...
如果再连续的单元格中查找使用VBA函数instr,如果在不连续的列中使用find方法、findnext。看你具体表结构来采取不同的办法。你应该具体说明或者截图。
Set Rng = Sheet2.Range("a:a").Find(Sheet1.Range("a1"))If Not (Rng Is Nothing) Then RngAddress = Rng.Address Do Rng.Offset(0, 1).Resize(1, 16).Copy Sheet1.Cells(Rows.Count, 2).End(xlUp)(2, 1)Set Rng = Sheet2.Range("a:a").FindNext(Rng)Loop Until RngAddress...
如果找到了,则对该单元格做条件判断,做完条件判断也需要再查找下一个,跟你的这个条件是没有关系的。。所以应该是:Do If criterior_Check(currentRow, c1.Row, conType) Then xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Set c1 = .FindNext(c1)Else Set c1 = .FindNext(c1)End If Loop While Not ...
For i = 1 To 3 With Worksheets(i).UsedRange Set c = .Find(s, LookIn:=xlValues)If Not c Is Nothing Then iAdd = c.Address Do ListBox1.AddItem For j = 0 To 6 ListBox1.List(ListBox1.ListCount - 1, j) = c(1, j + 1)Next Set c = .FindNext(c)If c Is ...
解决办法如下:1、首先,打开Excel,创建一个数据表格,接下来以下图为例进行演示,如下图所示,然后进入下一步。2、其次,需要调出日期中的月份和数字。将光标移动到单元格“ B2”,然后在菜单栏中单击“公式”,选择文本-find,如下图所示,然后进入下一步。3、接着,在弹出窗口中,输入内容,如下...
ClearSet Rng = Sheets(1).Columns(2).Find(TextBox1.Text, lookat:=xlWhole)If Not Rng Is Nothing ThenListBox1.AddItem (Rng)For j = Rng.Row + 1 To Sheets(1).Cells(Rows.Count, 2).End(3).RowIf Sheets(1).Cells(j, 2) = Rng ThenListBox1.AddItem (Rng)End IfNext jEnd...
Set rFind = .FindNext(rFind)Loop While Not rFind Is Nothing And rFind.Address <> firstAddress Else MsgBox "无此查询数据!", vbExclamation, "查询"Exit Sub End If End With Return End Sub 本程序采用穷举法,把符合条件的都能找出来列在第2个表中。当然,更高级的查询可以采用窗口来做...
Set c = .FindNext(c)Loop While Not c Is Nothing And c.Address <> p End If End With MsgBox "查找数据在以下单元格中:" & vbCrLf & vbCrLf _& q, vbInformation + vbOKOnly, "查找结果"Application.ScreenUpdating = True Application.DisplayAlerts = True End Sub 6.现在回到EXCEL表格...