-1
你能幫我請創建一個從磁盤搜索文件的宏, 請看:C:\Etikety\Stitky\
。 我搜索一個名稱,其中包含的單元格C2
和文件類型是.lbe
當文件發現打印它。 我會將這部分代碼實現到此代碼中。謝謝答覆excel宏VBA搜索和打印文件
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub zadat()
Dim reg, check As String
Dim i, j, done As Integer
reg = Cells(2, 3).Value
check = Cells(4, 3).Value
If check = "True" Then
i = 2
j = 1
done = 0
Do While Sheets("data").Cells(i, j) <> ""
If Sheets("data").Cells(i, j) = reg Then
done = Sheets("data").Cells(i, j + 3)
done = done + 1
Sheets("data").Cells(i, j + 3) = done
Exit Do
End If
i = i + 1
Loop
Else
MsgBox ("Chyba, oprav!!!")
End If
Cells(3, 3) = ""
Cells(3, 3).Select
ActiveWindow.ScrollRow = Cells(1, 1).row
End Sub
http://stackoverflow.com/questions/20687810/vba-macro-that-search-for -file-in-multiple-subfolders – Slai