Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

20 Nisan 2004 Salı

LCase, Ucase and Proper Strings


'Module1

Option Explicit
Dim c As Variant

Sub BüyükHarfeÇevir()
On Error Resume Next
For Each c In Selection.Cells
c.Value = UCase$(c.Value)
Next c
End Sub
Sub KüçükHarfeÇevir()
On Error Resume Next
For Each c In Selection.Cells
c.Value = LCase$(c.Value)
Next c
End Sub
Sub YazımDüzenineÇevir()
On Error Resume Next
For Each c In Selection.Cells
c.Value = Application.WorksheetFunction.Proper(c.Value)
Next c
End Sub

'Sheets("Sayfa1") Module

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim Alan, Yer As Range
Set Alan = Range("A1:I1000")
Application.EnableEvents = False
For Each Yer In Range(Target.Address)
If Not Application.Intersect(Yer, Alan) Is Nothing Then
Yer.Value = UCase(Yer.Value)
End If
Next Yer
Application.EnableEvents = True
Set Alan = Nothing
End Sub

'Sheets("Sayfa2") Module

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim Alan, Yer As Range
Set Alan = Range("A1:I1000")
Application.EnableEvents = False
For Each Yer In Range(Target.Address)
If Not Application.Intersect(Yer, Alan) Is Nothing Then
If Yer <> "" Then
Yer.Value = UCase(Mid(Yer.Value, 1, 1)) & LCase(Mid(Yer.Value, 2, Len(Yer.Value) - 1))
End If
End If
Next Yer
Application.EnableEvents = True
Set Alan = Nothing
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