Moderatori: Anthony47, Flash30005
Sub findStr()
Dim IFound, I As Long, myF As String, myPath As String, myType As String, LastA As Long
'
myPath = Range("B1") & "\"
myType = Range("B2") & "*"
'
LastA = Cells(Rows.Count, 1).End(xlUp).Row
'
If Mid(myPath, 2, 1) = ":" Then ChDrive Left(myPath, 1)
myF = Dir(myPath & "*." & myType)
Application.EnableEvents = False
With ThisWorkbook.ActiveSheet
While myF <> ""
Application.ScreenUpdating = True: DoEvents
.Range("B4") = .Range("B4") + 1
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Workbooks.Open myPath & myF
Application.DisplayAlerts = True
For I = 8 To LastA
mylook = .Cells(I, 1).Value
Set IFound = ActiveSheet.Cells.Find(what:=mylook, LookIn:=xlValues, LookAt:=xlPart)
If Not IFound Is Nothing Then
.Cells(Rows.Count, 4).End(xlUp).Offset(1, 0) = myPath & myF
.Range("B5") = .Range("B5") + 1
Exit For
End If
Next I
ActiveWorkbook.Close False
myF = Dir
Wend
End With
Application.EnableEvents = True
MsgBox ("Completato")
End Sub
Torna a Applicazioni Office Windows
Macro modifica date scelta periodo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 11 |
Inserire dati filtrati da 2 file ad un terzo file Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 14 |
Supporto per sviluppo macro VBA Ordinare per data Autore: Carletto Ribolla |
Forum: Applicazioni Office Windows Risposte: 3 |
Visitano il forum: Nessuno e 13 ospiti