OVH Cloud OVH Cloud

VBA débloqué cellule si verte

5 réponses
Avatar
serge
Bonjour à tous,

J'aimerai avoir un macro qui débloque les cellules qui sont verte, je
pensais donc à :

For each ws In ActiveWorkbook.Worksheets
for each cc in ws.range
if range.selection.interior.ColorIndex = 43 then Selection.Locked = False
endif
next cc
nex ws

endsub
mais le problème se pose au niveau de la ligne 2... quelqu'un peut m'aider
stp?

merci d'avance,

serge

5 réponses

Avatar
anonymousA
bonjour,

For Each ws In ActiveWorkbook.Worksheets
For Each cc In ws.UsedRange
If cc.Interior.ColorIndex = 43 Then cc.Locked = False
Next
Next

mais ca peut être un peu long suivant la taille des plages.

A+


Bonjour à tous,

J'aimerai avoir un macro qui débloque les cellules qui sont verte, je
pensais donc à :

For each ws In ActiveWorkbook.Worksheets
for each cc in ws.range
if range.selection.interior.ColorIndex = 43 then Selection.Locked = False
endif
next cc
nex ws

endsub
mais le problème se pose au niveau de la ligne 2... quelqu'un peut m'aider
stp?

merci d'avance,

serge


Avatar
serge
MErci mais j'ai un autre problème maintenant....
Il n'accepte pas les cellules fusionnées....Et je sais vraiment pas comment
controuner le probleme...
Quelqu'un a eu idée??

merci

"anonymousA" wrote:

bonjour,

For Each ws In ActiveWorkbook.Worksheets
For Each cc In ws.UsedRange
If cc.Interior.ColorIndex = 43 Then cc.Locked = False
Next
Next

mais ca peut être un peu long suivant la taille des plages.

A+


Bonjour à tous,

J'aimerai avoir un macro qui débloque les cellules qui sont verte, je
pensais donc à :

For each ws In ActiveWorkbook.Worksheets
for each cc in ws.range
if range.selection.interior.ColorIndex = 43 then Selection.Locked = False
endif
next cc
nex ws

endsub
mais le problème se pose au niveau de la ligne 2... quelqu'un peut m'aider
stp?

merci d'avance,

serge




Avatar
anonymousA
re,

For Each ws In ActiveWorkbook.Worksheets
For Each cc In ws.UsedRange
If cc.Interior.ColorIndex = 43 Then
If cc.MergeCells Then
cc.MergeArea.Locked = False
End If
End If
Next
Next

A+


MErci mais j'ai un autre problème maintenant....
Il n'accepte pas les cellules fusionnées....Et je sais vraiment pas comment
controuner le probleme...
Quelqu'un a eu idée??

merci

"anonymousA" wrote:

bonjour,

For Each ws In ActiveWorkbook.Worksheets
For Each cc In ws.UsedRange
If cc.Interior.ColorIndex = 43 Then cc.Locked = False
Next
Next

mais ca peut être un peu long suivant la taille des plages.

A+


Bonjour à tous,

J'aimerai avoir un macro qui débloque les cellules qui sont verte, je
pensais donc à :

For each ws In ActiveWorkbook.Worksheets
for each cc in ws.range
if range.selection.interior.ColorIndex = 43 then Selection.Locked = False
endif
next cc
nex ws

endsub
mais le problème se pose au niveau de la ligne 2... quelqu'un peut m'aider
stp?

merci d'avance,

serge






Avatar
anonymousA
erratum

For Each ws In ActiveWorkbook.Worksheets
For Each cc In ws.UsedRange
If cc.Interior.ColorIndex = 43 Then
If cc.MergeCells Then
cc.MergeArea.Locked = False
Else
cc.Locked = False
End If

End If

Next
Next



MErci mais j'ai un autre problème maintenant....
Il n'accepte pas les cellules fusionnées....Et je sais vraiment pas comment
controuner le probleme...
Quelqu'un a eu idée??

merci

"anonymousA" wrote:

bonjour,

For Each ws In ActiveWorkbook.Worksheets
For Each cc In ws.UsedRange
If cc.Interior.ColorIndex = 43 Then cc.Locked = False
Next
Next

mais ca peut être un peu long suivant la taille des plages.

A+


Bonjour à tous,

J'aimerai avoir un macro qui débloque les cellules qui sont verte, je
pensais donc à :

For each ws In ActiveWorkbook.Worksheets
for each cc in ws.range
if range.selection.interior.ColorIndex = 43 then Selection.Locked = False
endif
next cc
nex ws

endsub
mais le problème se pose au niveau de la ligne 2... quelqu'un peut m'aider
stp?

merci d'avance,

serge






Avatar
serge
Merci,

mais en fait je me retrouve avec le message suivant :'Unable to set the
Locked property of the range class".....
Je cherche

serge


erratum

For Each ws In ActiveWorkbook.Worksheets
For Each cc In ws.UsedRange
If cc.Interior.ColorIndex = 43 Then
If cc.MergeCells Then
cc.MergeArea.Locked = False
Else
cc.Locked = False
End If

End If

Next
Next



MErci mais j'ai un autre problème maintenant....
Il n'accepte pas les cellules fusionnées....Et je sais vraiment pas comment
controuner le probleme...
Quelqu'un a eu idée??

merci

"anonymousA" wrote:

bonjour,

For Each ws In ActiveWorkbook.Worksheets
For Each cc In ws.UsedRange
If cc.Interior.ColorIndex = 43 Then cc.Locked = False
Next
Next

mais ca peut être un peu long suivant la taille des plages.

A+


Bonjour à tous,

J'aimerai avoir un macro qui débloque les cellules qui sont verte, je
pensais donc à :

For each ws In ActiveWorkbook.Worksheets
for each cc in ws.range
if range.selection.interior.ColorIndex = 43 then Selection.Locked = False
endif
next cc
nex ws

endsub
mais le problème se pose au niveau de la ligne 2... quelqu'un peut m'aider
stp?

merci d'avance,

serge