Hi all,
I want my sheet to delete all conditional formatting when I process my sheet see code.
where can I put a code in the below vba code?
Private Sub LoginButton3_Click()
If TextBox1 = "5555" Then
ActiveSheet.Unprotect password:="5555"
ActiveSheet.Unprotect
Range("G6").Select
Selection.ClearContents
Range("G7").Select
Selection.ClearContents
Range("H7:L7").Select
Selection.ClearContents
Range("G8").Select
Selection.ClearContents
Range("H8:L8").Select
Selection.ClearContents
Range("H10:L10").Select
Selection.ClearContents
Range("G9").Select
Selection.FormatConditions.Delete
ActiveCell.FormulaR1C1 = "Ref number:"
Range("G2").Select
ActiveCell.FormulaR1C1 = "NOTE"
Range("G2").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("H2:K2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
ActiveCell.FormulaR1C1 = "=TEXT(DATUM!R[-1]C[-7],""yymmdd.hhmm"")"
Selection.NumberFormat = "@"
If Range("B5").Value <> "" Then
Range("B6").Value = Evaluate("=VLookup(B5,SEARCHEN, 8, 0)")
End If
Else
MsgBox "Wrong Password"
End If
Unload Me
End Sub
thank Steel010
I want my sheet to delete all conditional formatting when I process my sheet see code.
where can I put a code in the below vba code?
Private Sub LoginButton3_Click()
If TextBox1 = "5555" Then
ActiveSheet.Unprotect password:="5555"
ActiveSheet.Unprotect
Range("G6").Select
Selection.ClearContents
Range("G7").Select
Selection.ClearContents
Range("H7:L7").Select
Selection.ClearContents
Range("G8").Select
Selection.ClearContents
Range("H8:L8").Select
Selection.ClearContents
Range("H10:L10").Select
Selection.ClearContents
Range("G9").Select
Selection.FormatConditions.Delete
ActiveCell.FormulaR1C1 = "Ref number:"
Range("G2").Select
ActiveCell.FormulaR1C1 = "NOTE"
Range("G2").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("H2:K2").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
ActiveCell.FormulaR1C1 = "=TEXT(DATUM!R[-1]C[-7],""yymmdd.hhmm"")"
Selection.NumberFormat = "@"
If Range("B5").Value <> "" Then
Range("B6").Value = Evaluate("=VLookup(B5,SEARCHEN, 8, 0)")
End If
Else
MsgBox "Wrong Password"
End If
Unload Me
End Sub
thank Steel010