Moderatori: Anthony47, Flash30005
=SE(MESE($AC2+1)=MESE($A1);$AC2+1;"")
=SE(MESE($A$1+RIF.COLONNA(A1)-1)=MESE($A$1);$A$1+RIF.COLONNA(A1)-1;"")
=SE(VAL.NUMERO(B2);SE(GIORNO.SETTIMANA(B2;2)<6;TESTO(B2;"ggg");"-");"")
=SE(RIF.COLONNA()<5;$A12+RIF.COLONNA()-2;SE(GIORNO($A12+RIF.COLONNA()-2)<GIORNO(A13);"";$A12+RIF.COLONNA()-2))
=SE(B13="";"";GIORNO.SETTIMANA($A12+RIF.COLONNA()-2))
=SE(SE(B$13="";0;GIORNO.SETTIMANA($A$12+RIF.COLONNA()-2,2))>5;1;0)
=SE(MESE($A$12+RIF.COLONNA(A12)-1)=MESE($A$12);$A$12+RIF.COLONNA(A1)-1;"")
=SE(VAL.NUMERO(B15);SE(GIORNO.SETTIMANA(B15;2)<6;TESTO(B15;"ggg");"-");"")
Flash30005 ha scritto:Procediamo per passi
Non sapendo dove hai inserito il mese e l'anno ho considerato l'inserimento in A12 dove inserirai 01/06/2013 con formattazione "mmmm aaaa"
Nella cella D13 inserisci questa formula (Attenzione inseriscila in D13 non B13 poi la copierai anche in C e B)
- Codice: Seleziona tutto
=SE(RIF.COLONNA()<5;$A12+RIF.COLONNA()-2;SE(GIORNO($A12+RIF.COLONNA()-2)<GIORNO(A13);"";$A12+RIF.COLONNA()-2))
Trascina fino a AF
In B14 inserisci questa formula
- Codice: Seleziona tutto
=SE(B13="";"";GIORNO.SETTIMANA($A12+RIF.COLONNA()-2))
Trascini fino ad AF
Ora noto un'anomalia nella tabella perché se inserisci una formula per vedere i trattini chiaramente non potrai scriverci nulla a meno che non vada a cancellare la formula quindi opterei per una formattazione condizionale dove saranno colorate le celle (arancio) nei giorni di sabato e domenica quindi in formattazione condizionale dalla cella B15 alla cella AF fino dove vuoi come riga inserisci questa formula
- Codice: Seleziona tutto
=SE(SE(B$13="";0;GIORNO.SETTIMANA($A$12+RIF.COLONNA()-2,2))>5;1;0)
Formato fondo colore arancio o rosso
Per maggior chiarezza allego questo file
Public Agg As Integer
Sub SegnaF()
UR = Worksheets("Foglio1").Range("A" & Rows.Count).End(xlUp).Row
If Agg = 0 Then Range("B15:AF1000").Clear
For RR = 15 To UR
For CC = 2 To 32
If Cells(14, CC).Value <> "" Then
If Weekday(Cells(14, CC).Value, 2) = 6 Or Weekday(Cells(14, CC).Value, 2) = 7 Then
Application.EnableEvents = False
Cells(RR, CC).Value = "-"
Cells(RR, CC).HorizontalAlignment = xlCenter
Application.EnableEvents = True
End If
End If
Next CC
Next RR
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Area1 = "A12"
Area2 = "A15:A100"
If Application.Intersect(Target, Range(Area1)) Is Nothing Then GoTo SaltaA1
Agg = 0
SegnaF
SaltaA1:
If Application.Intersect(Target, Range(Area2)) Is Nothing Then Exit Sub
Agg = 1
SegnaF
End Sub
Sub Calendario()
Range("B13:AF1000").ClearContents
For GG = 1 To 31
If Month(DateSerial(Year([J12]), Month([J12]), GG)) <> Month([J12]) Then GoTo esci
Application.EnableEvents = False
Cells(13, GG + 1).Value = DateSerial(Year([J12]), Month([J12]), GG)
Cells(14, GG + 1).Value = Format(Weekday(DateSerial(Year([J12]), Month([J12]), GG), 1), "ddd")
Application.EnableEvents = True
Next GG
esci:
SegnaF
End Sub
Sub SegnaF()
UR = Worksheets("Foglio1").Range("A" & Rows.Count).End(xlUp).Row
For RR = 15 To UR
For CC = 2 To 32
If Cells(14, CC).Value <> "" Then
If Weekday(Cells(13, CC).Value, 2) = 6 Or Weekday(Cells(13, CC).Value, 2) = 7 Then
Application.EnableEvents = False
Cells(RR, CC).Value = "-"
Cells(RR, CC).HorizontalAlignment = xlCenter
Application.EnableEvents = True
End If
End If
Next CC
Next RR
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Area1 = "J12"
Area2 = "A15:A100"
If Application.Intersect(Target, Range(Area1)) Is Nothing Then GoTo SaltaA1
Calendario
SaltaA1:
If Application.Intersect(Target, Range(Area2)) Is Nothing Then Exit Sub
SegnaF
End Sub
If Agg = 0 Then Range("B15:AF1000").ClearContents
Torna a Applicazioni Office Windows
Excel: formula automatica per evidenziare prodotto scaduto Autore: gamma_ray |
Forum: Applicazioni Office Windows Risposte: 3 |
Salvare file excel in formato html escludendo le immagini Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 10 |
formula excel non visualizza risultato Autore: tommasog |
Forum: Applicazioni Office Windows Risposte: 6 |
Excel 2016 - Funzione SCARTO + INDIRETTO Autore: pl1957 |
Forum: Applicazioni Office Windows Risposte: 2 |
Visitano il forum: Nessuno e 76 ospiti