0
我的代码存在问题。它不承认Empty Cell
。如果单元格为空然后条件为
的条件是“如果单元格是空的,然后重复,否则更改文本的字体在当前单元格上方的单元格”
Sub lastprice()
Dim price As String
Do
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 11
.Bold = True
End With
With Selection.Find
.Text = "last price ("
.Forward = True
.Wrap = wdFindStop
.Format = True
End With
Selection.Find.Execute
If Selection.Find.Found = False Then
Exit Do
Else
Selection.MoveRight Unit:=wdCell
price = Trim(Selection.Text)
If price <> "" Then ' I think there is some problem
Selection.MoveLeft Unit:=wdCell, Count:=2
Selection.Font.Name = "Cambria"
Selection.MoveDown Unit:=wdLine, Count:=1
Else
End If
End If
Loop
End Sub
有关详情,请
它应该用条件更详细阐述通过表中的第二图像
我已经添加第二个图像,以更具体地关于循环 –