在excel宏中,编写find语句如何?
Cells.Find(What:="刘备").Activate 如果找不到,转到下一句Cells.Find(What:="关羽").Activate 再找不到,结束宏
Sub 查找() With ActiveSheet.UsedRange Set c = .Find("刘备", lookat:=xlWhole) If Not c Is Nothing Then c.Activate Else Set c = .Find("关羽", lookat:=xlWhole) If Not c Is Nothing Then c.Activate End If End If End With End Sub
答:Sub 查找() With ActiveSheet.UsedRange Set c = .Find("刘备", lookat:=xlWhole) If Not ...详情>>