首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

Excel文本查找的有关问题啊死了快

2012-01-30 
Excel文本查找的问题啊!!!!!急死了快IfIsFindFalseThenws.Cells.Find(What:Me.txtQuery.Text.Trim,After

Excel文本查找的问题啊!!!!!急死了快
If   IsFind   =   False   Then
                                ws.Cells.Find(What:=Me.txtQuery.Text.Trim,   After:=ws.Cells(1,   1),   LookIn:=Microsoft.Office.Interop.Excel.XlFindLookIn.xlFormulas,   _
                                                                LookAt:=Microsoft.Office.Interop.Excel.XlLookAt.xlPart,   _
                                                                SearchOrder:=Microsoft.Office.Interop.Excel.XlSearchOrder.xlByRows,   SearchDirection:=Microsoft.Office.Interop.Excel.XlSearchDirection.xlNext,   _
                                                                MatchCase:=False,   MatchByte:=False,   SearchFormat:=False).Activate()
                        Else
                                MsgBox(ws.ActiveCell.Address())
                                ws.Cells.FindNext(After:=ws.Application.Cells(ws.ActiveCell.Address())).Activate()
                        End   If

其中的isFind   是判断条件,第一次执行条件为真的,第二次执行条件为假的 <相当于查找下一个> .
第二个就出问题了,为什么总报一个, "未找到类型 'worksheet '的公共成员 'activecell ' "的错啊

[解决办法]
dim mCells As Range
mCells=ws.Cells.Find(...)
If mCells Is Nothing Then

Else

End If

在你的代码中,如果没有找到的话,能够Activate吗?



[解决办法]
没做过。帮顶。

热点排行