Makro oluşturmada kolaylık

Katılım
25 Mart 2007
Mesajlar
38
Excel Vers. ve Dili
2003
Arkadaşlar ben bu işe yeni başladım.Bazı ipuçları öğrendim.
Örnek:Makro oluştudan makro adını girelim.
a1 b1 c1 d1 e1 hücrelerinne hepsine bir isim girelim veli olsun.
yazı fontu 16 olsun,
a1 hücre rengi sarı,
b1 gücre rengi yeşil, gibi hücrelere değer verdiğimizde makro kaydet
işlemini yaptığımızda aşağıdaki gibi visual basic kod sayfasında kodların
otomatik olarak oluştuğunu göreceksiniz.
Option Explicit

Sub deneme2()
'
' deneme2 Makro
'

'
Range("A1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("B1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5287936
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("C1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -4.99893185216834E-02
.PatternTintAndShade = 0
End With
Range("D1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("E1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
Range("A1").Select
With Selection.Font
.Name = "Arial Black"
.Size = 16
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Range("B1").Select
With Selection.Font
.Name = "Arial Black"
.Size = 16
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Range("C1").Select
With Selection.Font
.Name = "Arial Black"
.Size = 16
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Range("D1").Select
With Selection.Font
.Name = "Arial Black"
.Size = 16
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Range("E1").Select
With Selection.Font
.Name = "Arial Black"
.Size = 16
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Range("A1").Select
ActiveCell.FormulaR1C1 = "VELİ"
Range("B1").Select
ActiveCell.FormulaR1C1 = "VELİ"
Range("C1").Select
ActiveCell.FormulaR1C1 = "VELİ"
Range("D1").Select
ActiveCell.FormulaR1C1 = "VELİ"
Range("E1").Select
ActiveCell.FormulaR1C1 = "VELİ"
Range("C3").Select
End Sub
Gördüğünüz kod'a ben hiç bir müdehale etmedim.
Büyük kolaylık.
 
Üst