Renk kodu

muratgunay48

Altın Üye
Katılım
10 Şubat 2010
Mesajlar
1,180
Excel Vers. ve Dili
Office 365 - Türkçe (64 bit)
Altın Üyelik Bitiş Tarihi
31-01-2025
Arkadaşlar, aslında geçen gün sorduğum sorunun devamı niteliğinde. Şöyle bir makro yaptım. Bir klasörden exceli alıp bir klasöre PDF formatında kaydediyor. İlk satır mavi yapmıştım. O değişecekmiş. Bu kodun neresini değiştirirsem ilk satır beyaz olur. Hepsini baştan yapmam gerekecek. Color yazan yeri değiştirdim ama olmadı.
Şimdiden teşekkür ederim.
Saygılarımla.


Sheets("TV").Select
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("F:I").Select
Selection.Delete Shift:=xlToLeft
Rows("1:2").Select
Selection.Delete Shift:=xlUp
Rows("1:1").Select
Selection.RowHeight = 25
Rows("2:532").Select
Selection.RowHeight = 17
With Selection.Font
.Name = "Arial"
.Size = 13
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Columns("A:A").Select
Selection.ColumnWidth = 4
Range("A1:E1").Select
With Selection.Font
.Name = "Arial"
.Size = 16
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Columns("B:B").Select
Selection.ColumnWidth = 17
Columns("C:C").Select
Selection.ColumnWidth = 17
Columns("D:D").Select
Selection.ColumnWidth = 25
Columns("E:E").Select
Selection.ColumnWidth = 40
Columns("E:E").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Rows("1:1").Select
With Selection
.HorizontalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Rows("1:1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("G5").Select
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = ""
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.118110236220472)
.RightMargin = Application.InchesToPoints(0.118110236220472)
.TopMargin = Application.InchesToPoints(0.748031496062992)
.BottomMargin = Application.InchesToPoints(0.748031496062992)
.HeaderMargin = Application.InchesToPoints(0.31496062992126)
.FooterMargin = Application.InchesToPoints(0.31496062992126)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = False
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = ""
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.118110236220472)
.RightMargin = Application.InchesToPoints(0.118110236220472)
.TopMargin = Application.InchesToPoints(0.748031496062992)
.BottomMargin = Application.InchesToPoints(0.748031496062992)
.HeaderMargin = Application.InchesToPoints(0.31496062992126)
.FooterMargin = Application.InchesToPoints(0.31496062992126)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = False
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = ""
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.118110236220472)
.RightMargin = Application.InchesToPoints(0.118110236220472)
.TopMargin = Application.InchesToPoints(0.748031496062992)
.BottomMargin = Application.InchesToPoints(0.748031496062992)
.HeaderMargin = Application.InchesToPoints(0.31496062992126)
.FooterMargin = Application.InchesToPoints(0.31496062992126)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 0
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = False
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = ""
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.31496062992126)
.RightMargin = Application.InchesToPoints(0.31496062992126)
.TopMargin = Application.InchesToPoints(0.748031496062992)
.BottomMargin = Application.InchesToPoints(0.748031496062992)
.HeaderMargin = Application.InchesToPoints(0.31496062992126)
.FooterMargin = Application.InchesToPoints(0.31496062992126)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = False
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
 

netzone

Altın Üye
Katılım
10 Mayıs 2006
Mesajlar
791
Excel Vers. ve Dili
🅾🅵🅵🅸🅲🅴
⎝365 64 Bit 𝙏𝙍⎠
🆆🅸🅽🅳🅾🆆🆂
⎝11 64 Bit 𝙏𝙍⎠
Altın Üyelik Bitiş Tarihi
12-09-2027
Arkadaşlar, aslında geçen gün sorduğum sorunun devamı niteliğinde. Şöyle bir makro yaptım. Bir klasörden exceli alıp bir klasöre PDF formatında kaydediyor. İlk satır mavi yapmıştım. O değişecekmiş. Bu kodun neresini değiştirirsem ilk satır beyaz olur. ...
With Selection.Font
.Name = "Arial"
.Size = 16
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
...
Merhaba,

.ColorIndex = xlAutomatic Bunun yerine
.ThemeColor = xlThemeColorDark1 Bunu eklerseniz, A1:E1 aralığınız beyaz olacaktır.

İyi çalışmalar.
 

muratgunay48

Altın Üye
Katılım
10 Şubat 2010
Mesajlar
1,180
Excel Vers. ve Dili
Office 365 - Türkçe (64 bit)
Altın Üyelik Bitiş Tarihi
31-01-2025
Merhaba,

.ColorIndex = xlAutomatic Bunun yerine
.ThemeColor = xlThemeColorDark1 Bunu eklerseniz, A1:E1 aralığınız beyaz olacaktır.

İyi çalışmalar.
Çok teşekkür ederim. Beni büyük bir külfetten kurtardınız.
Sormuş olayım. 1 değiştikçe renk değişiyor değil mi?
 

netzone

Altın Üye
Katılım
10 Mayıs 2006
Mesajlar
791
Excel Vers. ve Dili
🅾🅵🅵🅸🅲🅴
⎝365 64 Bit 𝙏𝙍⎠
🆆🅸🅽🅳🅾🆆🆂
⎝11 64 Bit 𝙏𝙍⎠
Altın Üyelik Bitiş Tarihi
12-09-2027
...
Sormuş olayım. 1 değiştikçe renk değişiyor değil mi?
Merhaba, Makro kaydet ile aldığım kodu ihtiyacınızı karşılayacağı düşüncesiyle paylaşmıştım.

xlThemeColor... Excel'inizde ayarlamış olduğunuz tema seçimine göre değişkenlik gösterir. Bu kod ile yapmış olduğunuz renk ataması sonrası Sayfa Düzeni > Renkler yolu ile erişebileceğiniz mevcut yada oluşturacağınız yeni Temanızı seçtiğinizde tanımlı hücrelerin renklerinin değiştiğini görebilirsiniz.

Siz dosyayı farklı bir bilgisayarda da kullanacaksanız söz konusu satırı .Color = -1 ile de değiştirebilirsiniz. Buradaki -1 Beyaz 0 Siyah'ı temsil eder, makro kaydet yoluyla kullanmak istediğiniz renk kodunu öğrenebilirsiniz.

İyi çalışmalar.

 

netzone

Altın Üye
Katılım
10 Mayıs 2006
Mesajlar
791
Excel Vers. ve Dili
🅾🅵🅵🅸🅲🅴
⎝365 64 Bit 𝙏𝙍⎠
🆆🅸🅽🅳🅾🆆🆂
⎝11 64 Bit 𝙏𝙍⎠
Altın Üyelik Bitiş Tarihi
12-09-2027
Kusura bakmayın yüklediğim gif için geçici adresten bağlantı almışım. Gif üzerinde gözlemleyebilirsiniz.

İyi çalışmalar.

2022-05-02_08-23-00.gif
 

muratgunay48

Altın Üye
Katılım
10 Şubat 2010
Mesajlar
1,180
Excel Vers. ve Dili
Office 365 - Türkçe (64 bit)
Altın Üyelik Bitiş Tarihi
31-01-2025
@netzone çok yardımcı oldu. Çok teşekkür ederim. Emeğine sağlık.
 
Üst