Skip to main content

AccessTr.neT


Tüm Sayfaların Font Ve Yazı Boyutu

Tüm Sayfaların Font Ve Yazı Boyutu

Çözüldü #1
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ı
Son Düzenleme: 05/03/2021, 00:00, Düzenleyen: hayalibey.
Cevapla
#2
SelectSheets yordamını Workbook_Open yordamının içine yazmayı dener misiniz?
Private Sub Workbook_Open()
SelectSheets
End Sub
Cevapla
#3

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ü.
Cevapla
#4
(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.
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da