不好意思 想再請問Bob
關於搜尋儲存格 以下程式碼
'跑每個EXCEL檔
For Each e In ar
If e <> w1 Then '不執行原先開啟的檔案
Workbooks.Open (myfloder & e)
s = Worksheets.Count
For j = 1 To s
Find = ActiveWorkbook.sheets(j).cells.Find(What:="Exchange Rate:", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, MatchByte:=False, SearchFormat:=False).Activate
Next
End If
Next
我想做的是參照作用中活頁簿 接著輪流搜尋參照作用中活頁簿的各工作表
但excel顯示物件不支援此功能 請問我該用哪一種屬性呢?作者: rbktwi 時間: 2015-1-9 10:59
已解決~
Dim fr As Range
Dim sh As Worksheet
For Each e In ar
If e <> w1 Then
Workbooks.Open (myfloder & e)
For Each sh In ActiveWorkbook.Worksheets
Set fr = sh.Cells.Find(what:="Exchange Rate:", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, MatchByte:=False, SearchFormat:=False)
If Not fr Is Nothing Then
Msgbox fr.Name
End If
Next sh
ActiveWindow.Close saveChanges:=True '關閉且儲存
End If
Next e