AW: VBA: Dateien kopieren / Dateien schützen ?
06.07.2007 14:17:15
Oberschlumpf
Hi Selma
Kopiere diese beiden Makros in ein allgemeines Modul
Sub markierte()
Dim lrZelle As Range
For Each lrZelle In Selection
If lrZelle.Hyperlinks.Count > 0 Then
FileCopy lrZelle.Hyperlinks(1).Address, "T:\Export\2007\" & lrZelle.Value
End If
Next
End Sub
Sub schreibschutz()
Dim I As Long
Dim MeinPfad As String, liZeile As Integer
Application.ScreenUpdating = False
Application.EnableEvents = False
MeinPfad = "T:\Eingang\IN"
liZeile = 1
With Application.FileSearch
.LookIn = MeinPfad
.SearchSubFolders = True
.Filename = "*.*"
If .Execute() > 0 Then
For I = 1 To .FoundFiles.Count
SetAttr .FoundFiles(I), vbReadOnly
Next I
End If
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
In Excel über Extras/Makro/Makros kannst du dann beide Makros ausführen.
Das erste Makro beantwortet deine erste Frage, das zweite Makro beantwortet deine zweite Frage.
Konnte ich helfen?
Ciao
Thorsten