Moderatori: Anthony47, Flash30005
Sub rinoma()
Dim myIPath As String, myOPath As String, I As Long
'
myIPath = Range("A1")
myOPath = Range("B1")
For I = 2 To Cells(Rows.Count, 1).End(xlUp).Row
If Dir(myIPath & Cells(I, "A").Value) = Cells(I, "A").Value Then
Name myIPath & Cells(I, "A").Value As myOPath & Cells(I, "B").Value
End If
Next I
End Sub
Anthony47 ha scritto:Quindi tu non vuoi rinominare il file ma vuoi crearne tante copie con nomi diversi...
Che tipo di file sono? Le regole di duplicazione /rinominazione dovo sono scritte?
Ciao
Sub copyNrename()
Dim FsO As Object, I As Long
'
Set FsO = VBA.CreateObject("Scripting.FileSystemObject")
Sheets("Rinomina").Select
For I = 2 To Cells(Rows.Count, "A").End(xlUp).Row
FsO.copyfile Range("A1").Value & Cells(I, 1).Value, Range("B1").Value & Cells(I, 2).Value
Next I
End Sub
Anthony47 ha scritto:Qualche prova l'ho fatta ma il collaudo devi farlo tu, e non garantisco il risultato:
- Codice: Seleziona tutto
Sub copyNrename()
Dim FsO As Object, I As Long
'
Set FsO = VBA.CreateObject("Scripting.FileSystemObject")
Sheets("Rinomina").Select
For I = 2 To Cells(Rows.Count, "A").End(xlUp).Row
FsO.copyfile Range("A1").Value & Cells(I, 1).Value, Range("B1").Value & Cells(I, 2).Value
Next I
End Sub
Fai sapere
Torna a Applicazioni Office Windows
Macro modifica date scelta periodo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 11 |
Supporto per sviluppo macro VBA Ordinare per data Autore: Carletto Ribolla |
Forum: Applicazioni Office Windows Risposte: 3 |
Inserire add.in nella barra di avvio veloce in excel 2003 Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 4 |
Excel: problema con date se devo unirle a testi Autore: valle1975 |
Forum: Applicazioni Office Windows Risposte: 5 |
Visitano il forum: Nessuno e 15 ospiti