remove conditional formating with vba code

STEEL010

Board Regular
Joined
Dec 29, 2017
Messages
76
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
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,216,080
Messages
6,128,692
Members
449,464
Latest member
againofsoul

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top