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

Macro e pulsante

Ultimo Aggiornamento: 23/06/2023 09:26
Post: 40
Registrato il: 06/11/2020
Età: 69
Utente Junior
Office Professional Plus 2016
OFFLINE
22/06/2023 12:43

Buongiorno a tutti, ho un problema ho delle macro (vedi sotto) per inserire in automatico giorno e colore cella per dei nominativi, vedi allegato, o inserto due nominativi nuovi (in allegato cerchiati di rosso) ma non mi riconosce la macro, sono le ultime due. Spero di essere riuscito a spiegarmi. Non capisco perché non le accetta. Se qualcuno può aiutarmi grazie in anticipo.
Macro e pulsante:
Sub colora()
Dim rng As Range
Dim cel As Range
Range("H7:U37").Interior.ColorIndex = xlNone
Set rng = Range("H7:U37")
For Each cel In rng
Select Case cel.Column
Case Is = 8
If Cells(cel.Row, 7).Value = "martedì" Then
cel.Interior.ColorIndex = 6
End If
Case Is = 10
If Cells(cel.Row, 7).Value = "venerdì" Then
cel.Interior.ColorIndex = 43
End If
Case Is = 12
If Cells(cel.Row, 7).Value = "lunedì" Then
cel.Interior.ColorIndex = 46
End If
Case Is = 14
If Cells(cel.Row, 7).Value = "sabato" Then
cel.Interior.ColorIndex = 33
End If
Case Is = 16
If Cells(cel.Row, 7).Value = "martedì" Then
cel.Interior.ColorIndex = 44
End If
Case Is = 18
If Cells(cel.Row, 7).Value = "giovedì" Then
cel.Interior.ColorIndex = 42
End If
Case Is = 20
If Cells(cel.Row, 7).Value = "lunedì" Or Cells(cel.Row, 7).Value = "giovedì" Then
cel.Interior.ColorIndex = 40
End If
Case Is = 24
If Cells(cel.Row, 7).Value = "mercoledì" Then
cel.Interior.ColorIndex = 6
End If
Case Is = 26
If Cells(cel.Row, 7).Value = "mercoledì" Then
cel.Interior.ColorIndex = 6
End If
End Select
Next cel
End Sub
Post: 3.019
Registrato il: 10/10/2013
Città: VICENZA
Età: 69
Utente Master
365
OFFLINE
22/06/2023 12:51

ciao
ma perchè non alleghi il file
Post: 40
Registrato il: 06/11/2020
Età: 69
Utente Junior
Office Professional Plus 2016
OFFLINE
22/06/2023 13:35

Re:
federico460, 22/06/2023 12:51:

ciao
ma perchè non alleghi il file




Post: 41
Registrato il: 06/11/2020
Età: 69
Utente Junior
Office Professional Plus 2016
OFFLINE
22/06/2023 19:07

Ti è arrivato il file? ciao
Post: 3.022
Registrato il: 10/10/2013
Città: VICENZA
Età: 69
Utente Master
365
OFFLINE
22/06/2023 19:22

ciao
guarda
Range("H7:U37").Interior.ColorIndex = xlNone
Set rng = Range("H7:U37")

e vedi le colonne del file lo capisci da solo
Post: 42
Registrato il: 06/11/2020
Età: 69
Utente Junior
Office Professional Plus 2016
OFFLINE
22/06/2023 19:32

Scusami ma non capisco, sto invecchiando
Post: 3.023
Registrato il: 10/10/2013
Città: VICENZA
Età: 69
Utente Master
365
OFFLINE
22/06/2023 19:41

ciao
se tu hai
un set Set rng = Range("H7:U37")
e vuoi aggiungere delle colonne lo adeguerai

metterai Set rng = Range("H7:V37") o fin dove ti serve
e lo stesso vale per
Range("H7:U37").Interior.ColorIndex = xlNone
Post: 43
Registrato il: 06/11/2020
Età: 69
Utente Junior
Office Professional Plus 2016
OFFLINE
22/06/2023 19:52

grazie OK, ho capito ho cambiato lettera ho messo la Y, però l'utima colonna la preso la penultima nò devo capire perchè. non riconosce le colonne v e
colonna w .
[Modificato da pikachu55 22/06/2023 20:03]
Post: 44
Registrato il: 06/11/2020
Età: 69
Utente Junior
Office Professional Plus 2016
OFFLINE
23/06/2023 09:26

Rissolto tutto grazie mille per l'aiuto.
Vota:
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]
Macro Pulsante Inserisci/Elimina Riga (2 messaggi, agg.: 22/11/2016 07:12)
eliminare buttom (pulsante) con macro (5 messaggi, agg.: 20/12/2016 21:11)
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 15:33. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com