Pagina precedente | 1 | Pagina successiva
Vota | Stampa | Notifica email    
Autore

Indicare numero con presenza decrescente

Ultimo Aggiornamento: 14/06/2017 22:11
Post: 2.008
Registrato il: 21/03/2008
Città: LOCATE VARESINO
Età: 76
Utente Veteran
2007 / 13
OFFLINE
13/06/2017 22:08

ciao

tanto per passare il tempo

una sub() o macro costruita col creatore e modificata in sequito in vari parametri
inserita nel modulo del foglio da te postato


Option Explicit
Sub Macro_col_creatore()
Dim cont As String
Dim i As Long
Dim cBB As Long
cBB = 54
Dim Nriga As Long

For i = 39 To 50
Range(Cells(3, i), Cells(17, i)).Select
Selection.Copy
Cells(3, cBB).Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveSheet.Range(Cells(2, cBB), Cells(17, cBB)).RemoveDuplicates Columns:=1, Header:= _
xlYes

Nriga = Cells(Rows.Count, cBB).End(xlUp).Row + 1 ''dimenticato
Cells(3, cBB + 1).Select
cont = "=COUNTIF(R3C" & i & ":R17C" & i & ",RC[-1])"
ActiveCell.FormulaR1C1 = cont
Selection.AutoFill Destination:=Range(Cells(3, cBB + 1), Cells(Nriga, cBB + 1)), Type:=xlFillDefault
Range(Cells(3, cBB), Cells(Nriga, cBB + 1)).Select
ActiveWorkbook.Worksheets("Helper").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Helper").Sort.SortFields.Add Key:=Cells(3, cBB + 1), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Helper").Sort
.SetRange Range(Cells(2, cBB), Cells(Nriga, cBB + 1))
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Helper").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Helper").Sort.SortFields.Add Key:=Range(Cells(3, cBB + 1), Cells(Nriga, cBB + 1)) _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Helper").Sort
.SetRange Range(Cells(2, cBB), Cells(Nriga, cBB + 1))
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range(Cells(8, cBB), Cells(Nriga, cBB + 1)).ClearContents
cBB = cBB + 2
Next i
End Sub





posto anche il file con la sub inserita

PS ho dimenticato un + 1 nella sub al calcolo della riga inseririto
in questa , manca nel file
Nriga = Cells(Rows.Count, cBB).End(xlUp).Row + 1
[Modificato da locatevaresino 13/06/2017 22:19]
Ciao da locate
excel 2007 / 13
Vota: 15MediaObject5,00116 1
Amministra Discussione: | Chiudi | Sposta | Cancella | Modifica | Notifica email Pagina precedente | 1 | Pagina successiva
Nuova Discussione
 | 
Rispondi
Cerca nel forum
Tag discussione
Discussioni Simili   [vedi tutte]
Come integrare 2 funzioni vba (4 messaggi, agg.: 23/01/2017 07:31)
AGGIORNARE TABBELLA PIVOT CON VBA (2 messaggi, agg.: 05/05/2019 10:02)
STAMPA CON VBA (5 messaggi, agg.: 09/11/2019 18:55)
Configuratore con Macro? (4 messaggi, agg.: 04/09/2017 17:57)
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 10:48. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com