Sostituisci
myFile = Replace(mySplit(0), "'", "") & Range("$b$1").Value & ".xlsm"
con
- Codice: Seleziona tutto
mySplit1= Split(Range("$D$2").Value, "]")
myFile = Replace(mySplit(0), "'", "") & Replace(mySplit1(0), "[", "")
Ciao
Moderatori: Anthony47, Flash30005
mySplit1= Split(Range("$D$2").Value, "]")
myFile = Replace(mySplit(0), "'", "") & Replace(mySplit1(0), "[", "")Private Sub Worksheet_Activate()
ActiveSheet.Unprotect
Dim myBase(1 To 4)
myBase(1) = "'E:\backlavoro\produzione\distinta insiemi\ZCZCX'!A3"
myBase(2) = "'E:\backlavoro\produzione\distinta insiemi\ZCZCX'!C3"
myBase(3) = "'E:\backlavoro\produzione\distinta insiemi\ZCZCX'!B3"
myBase(4) = "'E:\backlavoro\produzione\distinta insiemi\ZCZCX'!D3"
'Check esistenza file:
mySplit = Split(myBase(1), "[")
mySplit1 = Split(Range("$d$2").Value, "]")
myFile = Replace(mySplit(0), "'", "") & Replace(mySplit1(0), "[", "")
If Len(Dir(myFile)) = 0 Then
MsgBox ("il file " & myFile & " non esiste" & vbCrLf & _
"Le formule non sono state alterate")
Exit Sub
End If
'
Application.EnableEvents = False
LastA = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To 4
Cells(3, 1 + i).Resize(LastA - 3, 1).FormulaLocal = "=" & Replace(myBase(i), "ZCZCX", Range("$d$2").Value)
Next i
Application.EnableEvents = True
ActiveSheet.Name = Left([D2] & " " & [C2], 20)
ActiveSheet.Protect
End Sub
mySplit1= Split(Range("A1").Value, "]")myBase(1) = "'H:\produzione\scheda preventivo\[ZCZCX'!A3"
myBase(2) = "'H:\produzione\scheda preventivo\[ZCZCX'!C3"
'etc
'etcCells(3, 1 + i).Resize(LastA - 3, 1).FormulaLocal = "=" & Replace(myBase(i), "[ZCZCX", Range("A1").Value) Private Sub Worksheet_Activate()
ActiveSheet.Unprotect
Dim myBase(1 To 4)
myBase(1) = "'E:\backlavoro\produzione\distinta insiemi\[ZCZCX'!A3"
myBase(2) = "'E:\backlavoro\produzione\distinta insiemi\[ZCZCX'!C3"
myBase(3) = "'E:\backlavoro\produzione\distinta insiemi\[ZCZCX'!B3"
myBase(4) = "'E:\backlavoro\produzione\distinta insiemi\[ZCZCX'!D3"
'Check esistenza file:
mySplit = Split(myBase(1), "[")
mySplit1 = Split(Range("$A$1").Value, "]")
myFile = Replace(mySplit(0), "'", "") & Replace(mySplit1(0), "[", "")
If Len(Dir(myFile)) = 0 Then
MsgBox ("il file " & myFile & " non esiste" & vbCrLf & _
"Le formule non sono state alterate")
Exit Sub
End If
'
Application.EnableEvents = False
LastA = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To 4
Cells(3, 1 + i).Resize(LastA - 3, 1).FormulaLocal = "=" & Replace(myBase(i), "[ZCZCX", Range("$A$1").Value)
Next i
Application.EnableEvents = True
ActiveSheet.Name = Left([D2] & " " & [C2], 20)
ActiveSheet.Protect
End Sub
Cells(3, 1 + i - CLng(i > 4)).Resize(LastA - 3, 1).FormulaLocal = "=" & Replace(myBase(i), "[ZCZCX", Range("$A$1").Value)Torna a Applicazioni Office Windows
| Excel apre solo una schermata bianca Autore: jameswilson |
Forum: Applicazioni Office Windows Risposte: 1 |
| programma convertitore e taglia file video e audio Autore: gianscooby |
Forum: Audio/Video e masterizzazione Risposte: 3 |
Visitano il forum: Nessuno e 21 ospiti