我正在尝试循环并在一长串代码中找到一些组件以传递到不同的单元格。
现在我得到了这个
Sub przenoszenie()
Dim wb As Workbook
Dim komorka As Range
Dim komorka2 As Range
Set wb = ThisWorkbook
Set komorka = wb.Worksheets("Dane").Range("B2")
Set komorka2 = wb.Worksheets("Dane").Range("J2")
For i = 1 To 10000
If InStr(1, komorka.Value, "width=109") And InStr(1, komorka.Value, "colSpan=8") Then
komorka2.Value = komorka.Value
Else
If InStr(1, komorka.Value, "width=90") Then
komorka2.Value = komorka.Value
Else
If InStr(1, komorka.Value, "width=374") Then
komorka2.Value = komorka.Value
End If
End If
End If
komorka = komorka.Offset(1, 0)
komorka2 = komorka2.Offset(1, 0)
Next i
我知道我正在寻找的字符串部分位于我的 Excel 的 B 列中。
但是我在 J 栏中没有得到任何结果。我知道我在这些If
陈述中遗漏了一些东西。就是想不通;/