标题: 求教excel vba 中 WHILE 的用法问题 ,谢了 [打印本页] 作者: city0219 时间: 2006-11-2 01:07 标题: 求教excel vba 中 WHILE 的用法问题 ,谢了 Private Sub CommandButton1_Click()
Dim I As Integer
Dim B As String
I = 2
B = Sheets("22").Range("A1").Value
'If Sheets("11").Cells(I, 4).Value Like "*" & B & "*" Then Sheets("22").Cells(I, 1).Value = Sheets("11").Cells(I, 4).Value
While Sheets("11").Cells(I, 4).Value '???
If InStr(Sheets("11").Cells(I, 4).Value, B) Then Sheets("22").Cells(I, 1).Value = Sheets("11").Cells(I, 4).Value
I = I + 1
Wend