sløv makro
Kan dette speedes op, især Sub formaterforbrugPrivate Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Password = "xxx"
ActiveSheet.Unprotect Password
With Range("B2:C2")
.FormatConditions.Delete
.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="0"
.FormatConditions(1).Interior.ColorIndex = 15
End With
callsub: formaterforbrug
Password = "xxx"
ActiveSheet.Protect Password
Application.ScreenUpdating = True
End Sub
Sub formaterforbrug()
Range("B3:B13").Style = "forbrug post"
Range("B18:B28").Style = "forbrug post"
Range("B33:B43").Style = "forbrug post"
Range("D3:D13").Style = "forbrug post"
Range("D18:D28").Style = "forbrug post"
Range("D33:D43").Style = "forbrug post"
Range("F3:F13").Style = "forbrug post"
Range("F18:F28").Style = "forbrug post"
Range("F33:F43").Style = "forbrug post"
Range("H3:H13").Style = "forbrug post"
Range("H18:H28").Style = "forbrug post"
Range("H33:H43").Style = "forbrug post"
Range("J3:J13").Style = "forbrug post"
Range("J18:J28").Style = "forbrug post"
Range("J33:J43").Style = "forbrug post"
Range("L3:L13").Style = "forbrug post"
Range("L18:L28").Style = "forbrug post"
Range("L33:L43").Style = "forbrug post"
Range("N3:N13").Style = "forbrug post"
Range("N18:N28").Style = "forbrug post"
Range("N33:N43").Style = "forbrug post"
Range("P3:P13").Style = "forbrug post"
Range("P18:P28").Style = "forbrug post"
Range("P33:P43").Style = "forbrug post"
Range("R3:R13").Style = "forbrug post"
Range("R18:R28").Style = "forbrug post"
Range("R33:R43").Style = "forbrug post"
Range("T3:T13").Style = "forbrug post"
Range("T18:T28").Style = "forbrug post"
Range("T33:T43").Style = "forbrug post"
Range("V3:V13").Style = "forbrug post"
Range("V18:V28").Style = "forbrug post"
Range("V33:V43").Style = "forbrug post"
Range("C3:C13").Style = "forbrug pris"
Range("C18:C28").Style = "forbrug pris"
Range("C33:C43").Style = "forbrug pris"
Range("E3:E13").Style = "forbrug pris"
Range("E18:E28").Style = "forbrug pris"
Range("E33:E43").Style = "forbrug pris"
Range("G3:G13").Style = "forbrug pris"
Range("G18:G28").Style = "forbrug pris"
Range("G33:G43").Style = "forbrug pris"
Range("I3:I13").Style = "forbrug pris"
Range("I18:I28").Style = "forbrug pris"
Range("I33:I43").Style = "forbrug pris"
Range("K3:K13").Style = "forbrug pris"
Range("K18:K28").Style = "forbrug pris"
Range("K33:K43").Style = "forbrug pris"
Range("M3:M13").Style = "forbrug pris"
Range("M18:M28").Style = "forbrug pris"
Range("M33:M43").Style = "forbrug pris"
Range("O3:O13").Style = "forbrug pris"
Range("O18:O28").Style = "forbrug pris"
Range("O33:O43").Style = "forbrug pris"
Range("Q3:Q13").Style = "forbrug pris"
Range("Q18:Q28").Style = "forbrug pris"
Range("Q33:Q43").Style = "forbrug pris"
Range("S3:S13").Style = "forbrug pris"
Range("S18:S28").Style = "forbrug pris"
Range("S33:S43").Style = "forbrug pris"
Range("U3:U13").Style = "forbrug pris"
Range("U18:U28").Style = "forbrug pris"
Range("U33:U43").Style = "forbrug pris"
Range("W3:W13").Style = "forbrug pris"
Range("W18:W28").Style = "forbrug pris"
Range("W33:W43").Style = "forbrug pris"
End Sub
Lars
