Moderatori: Anthony47, Flash30005
Sub CreaWQSh()
'Vedi http://www.pc-facile.com/forum/viewtopic.php?f=26&t=107260
Dim I As Long, CD As Worksheet, NwSh As Long
'
Set CD = Sheets("Codici")
For I = 1 To CD.Cells(Rows.Count, 1).End(xlUp).Row
If Not ShExists(CD.Cells(I, 1).Value) Then
Sheets("Query").Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = CD.Cells(I, 1).Value
Range("E1") = CD.Cells(I, 1).Value
With Range("A4").QueryTable
' cconn = .Connection
.Connection = Replace(.Connection, "A2A.MI", CD.Cells(I, 1), 1, , vbTextCompare)
.Refresh False
NwSh = NwSh + 1
End With
End If
Next I
MsgBox ("Completato..." & vbCrLf & "(" & NwSh & " fogli creati)")
End Sub
Function ShExists(ByVal ShName As String) As Boolean
Dim DumMy As Worksheet
'
On Error Resume Next
Set DumMy = Sheets(ShName)
On Error GoTo 0
If DumMy Is Nothing Then ShExists = False Else ShExists = True
End Function
Torna a Applicazioni Office Windows
da correggere una macro con 3 variabili Autore: giorgioa |
Forum: Applicazioni Office Windows Risposte: 9 |
Supporto per Macro Query import pdf to excel Autore: JanVathek |
Forum: Applicazioni Office Windows Risposte: 10 |
Condizioni IIF nelle Query di Access Autore: GelriccaSud |
Forum: Applicazioni Office Windows Risposte: 2 |
Excel formula conta.se intervalli variabili da valore cella Autore: Statix |
Forum: Applicazioni Office Windows Risposte: 7 |
Visitano il forum: Nessuno e 17 ospiti