Una famiglia di software per fogli di calcolo Microsoft con strumenti per l'analisi, la creazione di grafici e la comunicazione dei dati.
Ciao Sergio,
ho caricato il file problematico su dropbox al link
https://www.dropbox.com/s/gqzf94i30o0exjz/Budget\_2018\_test.xlsm?dl=0
Il file non contiene dati sensibili. Una volta aperto, suggerisco di andare al foglio denominato "Avvertenze" come prima cosa, per capire la struttura del file.
Ho scaricato il tuo file e ho svelato l'arcano!
Nel tuo file c'è solo una macro, ossia una procedura chiamata Auto_Open. Questa è una vecchia procedura di evento con scope Private che verrà eseguita ogni volta che il file viene aperto. Come con tutte le procedure con scope private, questa macro non sarà inclusa nell'elenco delle macro.
La cancellazione della macro nel tuo file avrà effetto solo sul file stesso, ma ovviamente si rifletterà in tutti i file che creerai dal file master.
Se desideri vedere la tua macro elencata nell'elenco delle macro, prova a sostituire il tuo codice con qualcosa del genere:
'=========>>
Option Explicit
'--------->>
Private Sub Auto_Open()
Call Evidenzia_Giorno
End Sub
'--------->>
Public Sub Evidenzia_Giorno()
Range("A54").Select
a = Range("A54").Value
Range(Cells(1, a + 1), Cells(1, a + 1)).Select
Range( _
"B3:AF8,B11:AE13,B17:AE20,B22:AF25,B28:AF29,B31:AF34,B36:AF41,AF17:AF20,AF11:AF13" _
).Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range(Cells(3, a), Cells(8, a)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 11725054
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range(Cells(11, a), Cells(13, a)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 11725054
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range(Cells(17, a), Cells(20, a)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 11725054
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range(Cells(22, a), Cells(25, a)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 11725054
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range(Cells(28, a), Cells(29, a)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 11725054
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range(Cells(31, a), Cells(34, a)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 11725054
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range(Cells(36, a), Cells(41, a)).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 11725054
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range(Cells(11, a), Cells(11, a)).Select
End Sub
'<<=========
Dovresti poi assegnare la procedura Evidenzia_Giorno ai pulsanti di interesse.
NB:
Non ho tentato di modificare o migliorare il codice esistente.
===
Regards,
Norman