AccessTr.neT
Tüm Sayfaların Font Ve Yazı Boyutu - Baskı Önizleme

+- AccessTr.neT (https://accesstr.net)
+-- Forum: Microsoft Excel (https://accesstr.net/forum-microsoft-excel.html)
+--- Forum: Excel Cevaplanmış Soruları (https://accesstr.net/forum-excel-cevaplanmis-sorulari.html)
+--- Konu Başlığı: Tüm Sayfaların Font Ve Yazı Boyutu (/konu-tum-sayfalarin-font-ve-yazi-boyutu.html)



Tüm Sayfaların Font Ve Yazı Boyutu - hayalibey - 04/03/2021

Herkese Merhaba
Excel Çalışma Kitabındaki Tüm Sayfaların
Tüm Sayfaların dolgu renginin beyaz
1. Satırlarının (A1den son dolu sütuna kadar) Kırmızı kalın 14 punto Time News Roman
A1den son dolu sütuna kadar dolgu renginin yeşil
2. Satırdan itibaren (A2 den son dolu satıra kadar) mavi 12 punto Time News Roman
olması için Workbook Öpen () kısmına nasıl bir kod yazabilirim .

Sub SelectSheets()
Application.ScreenUpdating = False
For a = 1 To Sheets.Count
Sheets(a).Select
Cells.Interior.ColorIndex = 2
Range(Cells(1, 1), [XFD1].End(xlToLeft)).Select
Selection.Interior.ColorIndex = 4
With Selection.Font
.Name = "Times New Roman"
.Size = 14
.Color = -16776961
.Bold = True
End With

Range(Cells(2, 1), [A1048576].End(xlUp)).Select
With Selection.Font
.Name = "Times New Roman"
.Size = 12
.Color = -1003520
End With
[A1].Select
Next
Sheets(1).Select
Application.ScreenUpdating = True
End Sub
Bu kod çalışmadı


RE: Tüm Sayfaların Font Ve Yazı Boyutu - berduş - 05/03/2021

SelectSheets yordamını Workbook_Open yordamının içine yazmayı dener misiniz?
Private Sub Workbook_Open()
SelectSheets
End Sub



RE: Tüm Sayfaların Font Ve Yazı Boyutu - hayalibey - 10/03/2021


Option Explicit

Private Sub Workbook_Open()
Dim Sayfa As Worksheet, Son_Sutun As Integer, Son_Satir As Long

Application.ScreenUpdating = False

For Each Sayfa In ThisWorkbook.Worksheets
With Sayfa
.Select
.Cells.Interior.ColorIndex = 2
Son_Sutun = .Cells(1, .Columns.Count).End(1).Column
With .Cells(1, 1).Resize(, Son_Sutun)
.Font.Bold = True
.Font.ColorIndex = 3
.Font.Size = 14
.Font.Name = "Times News Roman"
.Interior.ColorIndex = 43
End With
Son_Satir = .Cells(.Rows.Count, 1).End(3).Row
If Son_Satir > 1 Then
With .Cells(2, 1).Resize(Son_Satir - 1)
.Font.Bold = True
.Font.ColorIndex = 41
.Font.Size = 12
.Font.Name = "Times News Roman"
End With
With .Cells(2, 1).Resize(Son_Satir - 1, Son_Sutun)
.Font.Size = 12
.Font.Name = "Times News Roman"
End With
End If
.Columns.AutoFit
End With
Next

Application.ScreenUpdating = True
End Sub

Hocam bu kodlarla sorun çözüldü.


RE: Tüm Sayfaların Font Ve Yazı Boyutu - feraz - 10/03/2021

(10/03/2021, 23:47)hayalibey yazdı: .Select
Bu gereksiz olmuş bence.Sayfaları tek tek seçtirmeye gerek yok.Tabii kodu silince çalışıma olayını test etmedim mantıken yazdım.