Moderatori: Anthony47, Flash30005
For A = LBound(Matrice, 1) To UBound(Matrice, 1)
Rba = 3 'Contatore Per Colore Celle e Font 5ne
For B = 1 To 11
'SCRIVE IL CONCORSO IN B:B(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11, -2).Resize(11, 1) = Matrice(A, 1)
'SCRIVE LA DATA IN C:C(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11, -1).Resize(11, 1) = Matrice(A, 2)
For C = 1 To 5
'SCRIVE LA 5na IN D2:H(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1) = Matrice(A, (B - 1) * 5 + C + 2)
'IMPOSTAZIONI PER COLORE CELLA E FONT 5na
Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1).Interior.Color = Range("BQ3").Cells(A, 1).Interior.Color
Color5a = Cells(Rba, 69).Interior.Color
Font5na = Cells(Rba, 69).Font.Color
'COLORE SOLO CELLA 5na
Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1).Interior.Color = Color5a
'COLORE SOLO CARATTERE 5na
Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1).Font.Color = Font5na
Next C
Rba = Rba + 1 'Contatore Per Colore Celle e Font 5ne
Next B
Rba = Rba + 1 'Contatore Per Colore Celle e Font 5ne
Next A
For A = LBound(Matrice, 1) To UBound(Matrice, 1)
Rba = 3 'Contatore Per Colore Celle e Font 5ne
For B = 1 To 11
'SCRIVE IL CONCORSO IN B:B(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11, -2).Resize(11, 1) = Matrice(A, 1)
'SCRIVE LA DATA IN C:C(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11, -1).Resize(11, 1) = Matrice(A, 2)
For C = 1 To 5
'SCRIVE LA 5na IN D2:H(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1) = Matrice(A, (B - 1) * 5 + C + 2)
'IMPOSTAZIONI PER COLORE CELLA E FONT 5na
Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1).Interior.Color = Range("BQ3").Cells(A, 1).Interior.Color
Color5a = Cells(Rba, 69).Interior.Color
Font5na = Cells(Rba, 69).Font.Color
'COLORE SOLO CELLA 5na
Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1).Interior.Color = Color5a
'COLORE SOLO CARATTERE 5na
Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1).Font.Color = Font5na
Next C
Rba = Rba + 1 'Contatore Per Colore Celle e Font 5ne
Next B
Rba = Rba + 1 'Contatore Per Colore Celle e Font 5ne
Next A
'IMPOSTAZIONI PER COLORE CELLA E FONT 5na
AA Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1).Interior.Color = Range("BQ3").Cells(A, 1).Interior.Color
BB Color5a = Cells(Rba, 69).Interior.Color
CC Font5na = Cells(Rba, 69).Font.Color
'COLORE SOLO CELLA 5na
DD Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1).Interior.Color = Color5a
'COLORE SOLO CARATTERE 5na
EE Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1).Font.Color = Font5na
For A = LBound(Matrice, 1) To UBound(Matrice, 1)
Rba = 3 'Contatore Per Colore Celle e Font 5ne
'SCRIVE IL CONCORSO IN B:B(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11, -2).Resize(11, 1) = Matrice(A, 1)
'SCRIVE LA DATA IN C:C(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11, -1).Resize(11, 1) = Matrice(A, 2)
For B = 1 To 11
Color5a = Cells(Rba, 69).Interior.Color
Font5na = Cells(Rba, 69).Font.Color
For C = 1 To 5
'SCRIVE LA 5na IN D2:H(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1) = Matrice(A, (B - 1) * 5 + C + 2)
Next C
'Applica formattazione alla 5na:
Range(Init5na).Offset((A - 1) * 11 + (B - 1), 0).Resize(1, 5).Interior.Color = Color5a
Range(Init5na).Offset((A - 1) * 11 + (B - 1), 0).Resize(1, 5).Font.Color = Font5na
Rba = Rba + 1 'Contatore Per Colore Celle e Font 5ne
Next B
Rba = Rba + 1 'Contatore Per Colore Celle e Font 5ne
Next A
LeRuote = Array("BA", "CA", "FI", "GE", "MI", "NA", "PA", "RM", "TO", "VE", "RN")
B = 0
iNteColor = Cells(2, 69).Interior.Color
iNteFont = Cells(2, 69).Font.Color
Do
B = B + 1
If Range(Init5na).Offset((B - 1) * 11, 0) = "" Then Exit Do
'SCRIVE LA RUOTA IN COLONNA I:I(end) OK VA BENE
Range(Init5na).Offset((B - 1) * 11, 5).Resize(11, 1) = Application.WorksheetFunction.Transpose(LeRuote)
'COLORE CELLA INTESTAZIONE SINGOLA BA(Colonna I:Iend)
Range(Init5na).Offset((D - 1), 5).Resize(1, 1).Interior.Color = iNteColor
'COLORE FONT INTESTAZIONE SINGOLA BA(Colonna I:Iend)
Range(Init5na).Offset((D - 1), 5).Resize(1, 1).Font.Color = iNteFont
D = D + 11 'Contatore Per Colore Intestazione BA Colonna I:Iend
Loop
Sub Due_CON_Colore_Rete()
Dim Matrice, A As Long, B As Long, C As Long, D As Long
Dim Init5na As String, uLtma As Long, LeRuote
'DIMENSIONE PER COLORE
Dim Color5a As Long, Font5na As Long, Rba As Long, iNteColor As Long, iNteFont As Long
'
Range("B2:I150000").Clear
D = 1 'Contatore Per Colore Intestazione BA Colonna I:Iend
Init5na = "D2" 'Inizio Scrittura 5ne
myTim = Timer
Application.ScreenUpdating = False
uLtma = Cells(Rows.Count, "A").End(xlUp).Row
'uLtma = 1000
Matrice = Range("K2:BO2").Resize(uLtma - 1).Value
For A = LBound(Matrice, 1) To UBound(Matrice, 1)
Rba = 3 'Contatore Per Colore Celle e Font 5ne
'SCRIVE IL CONCORSO IN B:B(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11, -2).Resize(11, 1) = Matrice(A, 1)
'SCRIVE LA DATA IN C:C(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11, -1).Resize(11, 1) = Matrice(A, 2)
For B = 1 To 11
Color5a = Cells(Rba, 69).Interior.Color
Font5na = Cells(Rba, 69).Font.Color
For C = 1 To 5
'SCRIVE LA 5na IN D2:H(end) OK VA BENE
Range(Init5na).Offset((A - 1) * 11 + (B - 1), C - 1) = Matrice(A, (B - 1) * 5 + C + 2)
Next C
'Applica formattazione alla 5na:
Range(Init5na).Offset((A - 1) * 11 + (B - 1), 0).Resize(1, 5).Interior.Color = Color5a
Range(Init5na).Offset((A - 1) * 11 + (B - 1), 0).Resize(1, 5).Font.Color = Font5na
Rba = Rba + 1 'Contatore Per Colore Celle e Font 5ne
Next B
Rba = Rba + 1 'Contatore Per Colore Celle e Font 5ne
Next A
'
'Application.ScreenUpdating = True
LeRuote = Array("BA", "CA", "FI", "GE", "MI", "NA", "PA", "RM", "TO", "VE", "RN")
B = 0
'
iNteColor = Cells(2, 69).Interior.Color
iNteFont = Cells(2, 69).Font.Color
Do
B = B + 1
If Range(Init5na).Offset((B - 1) * 11, 0) = "" Then Exit Do
'SCRIVE LA RUOTA IN COLONNA I:I(end) OK VA BENE
Range(Init5na).Offset((B - 1) * 11, 5).Resize(11, 1) = Application.WorksheetFunction.Transpose(LeRuote)
'COLORE CELLA INTESTAZIONE SINGOLA BA(Colonna I:Iend)
Range(Init5na).Offset((D - 1), 5).Resize(1, 1).Interior.Color = iNteColor
'COLORE FONT INTESTAZIONE SINGOLA BA(Colonna I:Iend)
Range(Init5na).Offset((D - 1), 5).Resize(1, 1).Font.Color = iNteFont
D = D + 11 'Contatore Per Colore Intestazione BA Colonna I:Iend
Loop
Application.ScreenUpdating = True
MsgBox ("Completato, sec: " & Format(Timer - myTim, "0.00"))
End Sub
Sub FormatUpdates()
Dim LastD As Long, I As Long
'
Range("D2:I12").Copy
LastD = Cells(Rows.Count, "D").End(xlUp).Row
For I = LastD - 10 To 2 Step -11
If Cells(I, "D").Interior.Color = xlNone Or _
Cells(I, "D").Interior.Color = RGB(255, 255, 255) Then
Cells(I, "D").PasteSpecial xlPasteFormats
Else
Exit For
End If
Next I
Application.CutCopyMode = False
End Sub
'Option Explicit
Sub DaOrizintale_a_Verticale_Aggiornamento_Rete()
'
Dim ultimariga, ultimarigaBA As Long
Dim BaiNtsCell, BaiNtsFon, BaCel, BaFon As Long
Dim CaCel, CaFon, FiCel, FiFon, GeCel, GeFon As Long
Dim MiCel, MiFon, NaCel, NaFon, PaCel, PaFon As Long
Dim RmCel, RmFon, ToCel, ToFon, VeCel, VeFon, RnCel, RnFon As Long
Dim myTim
'
myTim = Timer
Application.ScreenUpdating = False
Sheets("Demo").Select
'
ultimariga = Cells(Rows.Count, "D").End(xlUp).Row
ultimarigaBA = Cells(Rows.Count, "I").End(xlUp).Row
'BA INTESTAZIONE CELLA E FONT COLONNA I
BaiNtsCell = Range("I" & ultimarigaBA - 21).Interior.Color
BaiNtsFon = Range("I" & ultimarigaBA - 21).Font.Color
Range("I" & ultimarigaBA).Offset(0 - 10).Interior.Color = BaiNtsCell
Range("I" & ultimarigaBA).Offset(0 - 10).Font.Color = BaiNtsFon
'BA COLORE CELLA E FONT 5na
BaCel = Range("D" & ultimariga - 21).Interior.Color
BaFon = Range("D" & ultimariga - 21).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 10).Interior.Color = BaCel
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 10).Font.Color = BaFon
'CA COLORE CELLA E FONT 5na
CaCel = Range("D" & ultimariga - 20).Interior.Color
CaFon = Range("D" & ultimariga - 20).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 9).Interior.Color = CaCel
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 9).Font.Color = CaFon
'FI COLORE CELLA E FONT 5na
FiCel = Range("D" & ultimariga - 19).Interior.Color
FiFon = Range("D" & ultimariga - 19).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 8).Interior.Color = FiCel
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 8).Font.Color = FiFon
'GE COLORE CELLA E FONT 5na
GeCel = Range("D" & ultimariga - 18).Interior.Color
GeFon = Range("D" & ultimariga - 18).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 7).Interior.Color = GeCel
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 7).Font.Color = GeFon
'MI COLORE CELLA E FONT 5na
MiCel = Range("D" & ultimariga - 17).Interior.Color
MiFon = Range("D" & ultimariga - 17).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 6).Interior.Color = MiCel
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 6).Font.Color = MiFon
'NA COLORE CELLA E FONT 5na
NaCel = Range("D" & ultimariga - 16).Interior.Color
NaFon = Range("D" & ultimariga - 16).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 5).Interior.Color = NaCel
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 5).Font.Color = NaFon
'PA COLORE CELLA E FONT 5na
PaCel = Range("D" & ultimariga - 15).Interior.Color
PaFon = Range("D" & ultimariga - 15).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 4).Interior.Color = PaCel
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 4).Font.Color = PaFon
'RM COLORE CELLA E FONT 5na
RmCel = Range("D" & ultimariga - 14).Interior.Color
RmFon = Range("D" & ultimariga - 14).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 3).Interior.Color = RmCel
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 3).Font.Color = RmFon
'TO COLORE CELLA E FONT 5na
ToCel = Range("D" & ultimariga - 13).Interior.Color
ToFon = Range("D" & ultimariga - 13).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 2).Interior.Color = ToCel
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 2).Font.Color = ToFon
'VE COLORE CELLA E FONT 5na
VeCel = Range("D" & ultimariga - 12).Interior.Color
VeFon = Range("D" & ultimariga - 12).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 1).Interior.Color = VeCel
Range("D" & ultimariga, "H" & ultimariga).Offset(0 - 1).Font.Color = VeFon
'RN COLORE CELLA E FONT 5na
RnCel = Range("D" & ultimariga - 11).Interior.Color
RnFon = Range("D" & ultimariga - 11).Font.Color
Range("D" & ultimariga, "H" & ultimariga).Interior.Color = RnCel
Range("D" & ultimariga, "H" & ultimariga).Font.Color = RnFon
Application.ScreenUpdating = True
MsgBox ("Completato, sec: " & Format(Timer - myTim, "0.0"))
End Sub
Sub FormatUpdates()
Dim LastBa As Long, I As Long
'
LastBa = Evaluate("max((I1:I100000=""BA"")*Row(I1:I100000))")
For I = LastBa To 1 Step -11
'Cerca ultimo gruppo colorato:
If Cells(I, "I").Interior.Color <> xlNone And Cells(I, "I").Interior.Color <> RGB(255, 255, 255) Then Exit For
Next I
If I < 5 Then
MsgBox ("Nessun gruppo colorato? Procedura abortita")
Exit Sub
End If
'Copia il gruppo:
Cells(I, "D").Resize(11, 6).Copy
For I = I To LastBa - 1 Step 11
'Colora i gruppi sottostanti:
Cells(I + 11, "D").PasteSpecial xlPasteFormats
Next I
Application.CutCopyMode = False
End Sub
Torna a Applicazioni Office Windows
TextBox e Barra di scorrimento verticale Autore: Carletto Ribolla |
Forum: Applicazioni Office Windows Risposte: 1 |
Come fare per raddrizzare VBE da orizzontale a verticale . Autore: Gianca532011 |
Forum: Applicazioni Office Windows Risposte: 3 |
Visitano il forum: Nessuno e 16 ospiti