我正在尝试一种新的方法来连接数据库并从数据库中检索数据,但是我不知道为什么在布尔值上执行时我添加和删除了search_id,但仍然存在相同的问题,我试图更改{{1 }}在执行之前仍然存在相同的问题。
表格搜索:
Option Explicit
Sub test()
Dim str As String
Dim i As Long, LastRowA As Long, LastRowC As Long
With ThisWorkbook.Worksheets("Sheet1")
LastRowA = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To LastRowA
If InStr(1, .Range("A" & i).Value, ".") > 0 Then
If str = "" Then
str = .Range("A" & i).Value
Else
str = str & " " & .Range("A" & i).Value
End If
LastRowC = .Cells(.Rows.Count, "C").End(xlUp).Row
If LastRowC = 1 And .Range("C1").Value = "" Then
.Range("C" & LastRowC).Value = str
Else
.Range("C" & LastRowC + 1).Value = str
End If
str = ""
Else
If str = "" Then
str = .Range("A" & i).Value
Else
str = str & " " & .Range("A" & i).Value
End If
End If
Next i
End With
End Sub
我找不到错误:
bind_result