J'ai des problèmes avec la liste de code suivant:
ça bloque à la deuxième ligne déjà....
Merci
_______________________________________________
Sub creation()
Sheets("Creer").Select
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
J'ai des problèmes avec la liste de code suivant:
ça bloque à la deuxième ligne déjà....
Merci
_______________________________________________
Sub creation()
Sheets("Creer").Select
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
J'ai des problèmes avec la liste de code suivant:
ça bloque à la deuxième ligne déjà....
Merci
_______________________________________________
Sub creation()
Sheets("Creer").Select
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Pour faire référence à une colonne avec Cells()
la syntaxe n'est pas :
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
Mais if cells(12,"D") = "" or Cells(16,"D") = "" then
"Eric Dufour" a écrit dans le message de groupe de
discussion :
J'ai des problèmes avec la liste de code suivant:
ça bloque à la deuxième ligne déjà....
Merci
_______________________________________________
Sub creation()
Sheets("Creer").Select
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Pour faire référence à une colonne avec Cells()
la syntaxe n'est pas :
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
Mais if cells(12,"D") = "" or Cells(16,"D") = "" then
"Eric Dufour" <hahaha@videotron.ca> a écrit dans le message de groupe de
discussion :
eO3zfU8iJHA.5732@TK2MSFTNGP05.phx.gbl...
J'ai des problèmes avec la liste de code suivant:
ça bloque à la deuxième ligne déjà....
Merci
_______________________________________________
Sub creation()
Sheets("Creer").Select
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Pour faire référence à une colonne avec Cells()
la syntaxe n'est pas :
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
Mais if cells(12,"D") = "" or Cells(16,"D") = "" then
"Eric Dufour" a écrit dans le message de groupe de
discussion :
J'ai des problèmes avec la liste de code suivant:
ça bloque à la deuxième ligne déjà....
Merci
_______________________________________________
Sub creation()
Sheets("Creer").Select
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
'_______________________Macro pour Superficie visée et Superficie
J'ai des problèmes avec la liste de code suivant:
ça bloque à la deuxième ligne déjà....
Merci
_______________________________________________
Sub creation()
Sheets("Creer").Select
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
'_______________________Macro pour Superficie visée et Superficie
J'ai des problèmes avec la liste de code suivant:
ça bloque à la deuxième ligne déjà....
Merci
_______________________________________________
Sub creation()
Sheets("Creer").Select
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
'_______________________Macro pour Superficie visée et Superficie
J'ai des problèmes avec la liste de code suivant:
ça bloque à la deuxième ligne déjà....
Merci
_______________________________________________
Sub creation()
Sheets("Creer").Select
If (Cells(D, 12) = "" Or Cells(D, 16) = "") Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Essaie ceci :
If Range("D12")<>"" and Range("D16")<>""
Serge
"Eric Dufour" a écrit dans le message de news:débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la
protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Essaie ceci :
If Range("D12")<>"" and Range("D16")<>""
Serge
"Eric Dufour" <hahaha@videotron.ca> a écrit dans le message de news:
OtD67N9iJHA.1172@TK2MSFTNGP05.phx.gbl...
débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la
protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Essaie ceci :
If Range("D12")<>"" and Range("D16")<>""
Serge
"Eric Dufour" a écrit dans le message de news:débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la
protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Non, il y a un message d'erreur de Go To
"garnote" a écrit dans le message de news:Essaie ceci :
If Range("D12")<>"" and Range("D16")<>""
Serge
"Eric Dufour" a écrit dans le message de news:débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Non, il y a un message d'erreur de Go To
"garnote" <garnote3RIEN@videotron.ca> a écrit dans le message de news:OoNqrS9iJHA.1172@TK2MSFTNGP05.phx.gbl...
Essaie ceci :
If Range("D12")<>"" and Range("D16")<>""
Serge
"Eric Dufour" <hahaha@videotron.ca> a écrit dans le message de news: OtD67N9iJHA.1172@TK2MSFTNGP05.phx.gbl...
débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Non, il y a un message d'erreur de Go To
"garnote" a écrit dans le message de news:Essaie ceci :
If Range("D12")<>"" and Range("D16")<>""
Serge
"Eric Dufour" a écrit dans le message de news:débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Essaie ceci :
If Range("D12")<>"" and Range("D16")<>""
Serge
"Eric Dufour" a écrit dans le message de news:débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la
protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Essaie ceci :
If Range("D12")<>"" and Range("D16")<>""
Serge
"Eric Dufour" <hahaha@videotron.ca> a écrit dans le message de news:
OtD67N9iJHA.1172@TK2MSFTNGP05.phx.gbl...
débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la
protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub
Essaie ceci :
If Range("D12")<>"" and Range("D16")<>""
Serge
"Eric Dufour" a écrit dans le message de news:débloqué, mais, comment je fais pour avoir la condition suivante:
Il faut que les deux cellules soit rempli (D12 et D16)?
Merci
Éric De Montréal
(Youki, ta formule ne fonctionne pas)
Sub creation()
Sheets("Creer").Select
'If (Cells(D, 12) _) "" And Cells(D, 16) = "") Then
If Cells(4, 12) <> "0" And Cells(4, 16) <> "0" Then
MsgBox "Vous devez saisir le nom de votre établissement et le nom de
l'installation"
Else
Application.ScreenUpdating = False
Sheets("Formulaire").Visible = xlSheetVisible
Sheets("Formulaire").Select
Sheets("Formulaire").Copy After:=Sheets(Sheets.Count)
' Sheets(Sheets.Count - 1).Name = "Eric"
ActiveSheet.Unprotect Password:="Regie" '__________désactive la
protection
Range("C10").Select
'_________________EFFACE le texte
Range("H22").Select
Selection.ClearContents
Rows("22:22").RowHeight = 9.75
Range("O22").Select
'__________________ Copier-collage special valeur du type de financement
Range("H6").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("H7").Select
'___________________ Copier-coller specialement le nom d'installation
Range("D12").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
Range("D14").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:úlse, Transpose:úlse
Application.CutCopyMode = False
'_____________________Macro pour masquer si complémentaire dans P6
'Worksheets(Worksheets.Count).Select
If [P6].Value = 2 Then
Rows("40:41").EntireRow.Hidden = True
'___________________
Range("L48:L49").Select
Selection.Interior.ColorIndex = 34
Range("M48:M49").Select
Selection.Interior.ColorIndex = 2
Range("M48:M49").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
Rows("40:41").EntireRow.Hidden = False
'_______________________Macro pour Superficie visée et Superficie
Range("L51:L52").Select
Selection.Interior.ColorIndex = 34
Range("M51:M52").Select
Selection.Interior.ColorIndex = 2
Selection.Locked = False
Selection.FormulaHidden = False
'_______________________coloré
Range("M78").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 35
End With
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Selection.Locked = True
Selection.FormulaHidden = False
Range("A1").Select
End If
'_______________________Macro pour zoomer à la largeur
Range("A2:O10").Select
Range("O10").Activate
ActiveWindow.Zoom = True
Range("A1").Select
ActiveSheet.ScrollArea = "A1:O100"
Sheets("Formulaire").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Regie" '______________ l'active
Range("A1").Select
Application.ScreenUpdating = False
End If
End Sub