Moderatori: Anthony47, Flash30005
andrea tony ha scritto:Ciao Richy53
ho letto il tuo precedente messaggio...e de da circa due ore che sto lavorando sulle tabelle pivot senza riuscire a risolvere il mio problema.
Ho guardato anche diversi video tutorial per capirle meglio...ma non riesco a comprendrene bene l'utilità....almeno per il mio caso...
il problema è che mi sembrano troppo complesse da analizzare e comunque non si aggiornano in automatico
tieni presente che sto creando un foglio di calcolo che non userò io ma bensì delle terze persone che potrebbero non conoscere affatto excel.
Se riesci ad aiutarmi di più benvenga qualsiasi consiglio, forse sono io che non ne vedo l'utilità.
andrea
win7/excel 2010
Sub CreaElUniv()
Set Ws1 = Worksheets("Preventivi")
Set Ws2 = Worksheets("Query")
Ws1.Range("O1:Q65536").ClearContents
UR1 = Ws1.Range("A" & Rows.Count).End(xlUp).Row + 1
For RR1 = 1 To UR1
Cognome = Ws1.Range("B" & RR1).Value
Modello = Ws1.Range("D" & RR1).Value
Targa = Ws1.Range("E" & RR1).Value
UR1Q = Ws1.Range("Q" & Rows.Count).End(xlUp).Row
If Ws1.Range("Q" & UR1Q).Value <> "" Then UR1Q = UR1Q + 1
For RR1Q = 1 To UR1Q
If Ws1.Range("Q" & RR1Q).Value = Targa Then GoTo SaltaRR1
Next RR1Q
Ws1.Range("O" & UR1Q).Value = Cognome
Ws1.Range("P" & UR1Q).Value = Modello
Ws1.Range("Q" & UR1Q).Value = Targa
SaltaRR1:
Next RR1
End Sub
Private Sub UserForm_Terminate()
UserForm1.Hide
End Sub
Sub FormScript()
UR1Q = Worksheets("Preventivi").Range("Q" & Rows.Count).End(xlUp).Row
Application.EnableEvents = False
UserForm1.ComboBox1.RowSource = "Preventivi!O1:O" & UR1Q
UserForm1.ComboBox1.Value = "Cognome"
UserForm1.ComboBox2.RowSource = "Preventivi!P1:P" & UR1Q
UserForm1.ComboBox2.Value = "Modello"
UserForm1.ComboBox3.RowSource = "Preventivi!Q1:Q" & UR1Q
UserForm1.ComboBox3.Value = "Targa"
Application.Wait (Now + TimeValue("0:00:01"))
Application.EnableEvents = True
UserForm1.Show
End Sub
Private Sub Worksheet_Activate()
Worksheets("Query").Columns("A:F").ClearContents
CreaElUniv
FormScript
End Sub
Private Sub ComboBox1_Change()
Set Ws1 = Worksheets("Preventivi")
Set Ws2 = Worksheets("Query")
If UserForm1.Visible Then
Ws1.Range("A1:F1").Copy Destination:=Ws2.Range("A1")
UREA = Ws1.Range("A" & Rows.Count).End(xlUp).Row
Cognome = Me.ComboBox1
For RRA = 2 To UREA
If Cognome = Ws1.Range("B" & RRA).Value Then
Ws1.Range("A" & RRA & ":F" & RRA).Copy Destination:=Ws2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
UserForm1.Hide
End If
Next RRA
End If
End Sub
Private Sub ComboBox2_Change()
Set Ws1 = Worksheets("Preventivi")
Set Ws2 = Worksheets("Query")
If UserForm1.Visible Then
Ws1.Range("A1:F1").Copy Destination:=Ws2.Range("A1")
UREA = Ws1.Range("A" & Rows.Count).End(xlUp).Row
Modello = Me.ComboBox2
For RRA = 2 To UREA
If Modello = Ws1.Range("D" & RRA).Value Then
Ws1.Range("A" & RRA & ":F" & RRA).Copy Destination:=Ws2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
UserForm1.Hide
End If
Next RRA
End If
End Sub
Private Sub ComboBox3_Change()
Set Ws1 = Worksheets("Preventivi")
Set Ws2 = Worksheets("Query")
If UserForm1.Visible Then
Ws1.Range("A1:F1").Copy Destination:=Ws2.Range("A1")
UREA = Ws1.Range("A" & Rows.Count).End(xlUp).Row
Targa = Me.ComboBox3
For RRA = 2 To UREA
If Targa = Ws1.Range("E" & RRA).Value Then
Ws1.Range("A" & RRA & ":F" & RRA).Copy Destination:=Ws2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
UserForm1.Hide
End If
Next RRA
End If
End Sub
Torna a Applicazioni Office Windows
Inserire dati filtrati da 2 file ad un terzo file Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 14 |
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: Anthony47 e 5 ospiti