Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

1 Ocak 2005 Cumartesi

Do Contingent Format


'Module1

Option Explicit
Dim Hücre As Range
Dim Dur As Boolean

Sub ŞartaBağlıFormatYap() 'Do Contingent Format
On Error Resume Next
Dur = True
[A1] = 1: [B1] = 0
For Each Hücre In Range("C3:C17,D4:D6,E7:E9,F10:F12,G7:G9,H4:H6,I3:I5,J3:K17,M3:M14,N15:N16,O17:P17,Q15:R16,R3:S14")
With Hücre
.FormulaR1C1 = "=(RC[-1]*0.05)+RC[-1]"
.Font.Bold = True
.Font.Color = vbBlack
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
.Columns.AutoFit
.Rows.AutoFit
.FormatConditions.Delete
.FormatConditions.Add Type:=xlCellValue, Operator:=xlNotEqual, Formula1:="=$A$1"
With .FormatConditions(1).Interior
.PatternColorIndex = 37
.Pattern = xlGray50
End With
.FormatConditions.Add Type:=xlCellValue, Operator:=xlNotEqual, Formula1:="=$B$1"
With .FormatConditions(2).Interior
.PatternColorIndex = 6
.Pattern = xlGray50
End With
End With
Next Hücre
Call ŞartaBağlıFormatTesti
End Sub
Sub ŞartaBağlıFormatTesti()
On Error Resume Next
If Dur = False Then Exit Sub
If [A1] = 0 Then [A1] = 1 Else [A1] = 0
If [B1] = 0 Then [B1] = 1 Else [B1] = 0
Application.OnTime Now + TimeValue("00:00:01"), "ŞartaBağlıFormatTesti"
End Sub

Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul