bir hücrede yaptığım biçimi diğer hücrede de uygulansın

Katılım
20 Ocak 2007
Mesajlar
230
Excel Vers. ve Dili
Office 2003 TÜRKÇE
EXCEL97 İNGİLİZCE
ÖRNEK SAYFA A1 hücresinde yazı veya rakam rengini hangi renk yazarsam yazayım.
C3,K5,L8,D9,AA1 GİBİ hücrelerin rengi A1 hücre rengiyle aynı olması için hangi kod olması gerekir.
visual basic teyse nasıl yazılacağınada yazarsa çok iyi olur.
herkese teşekkürler.
 

N.Ziya Hiçdurmaz

Özel Üye
Katılım
28 Nisan 2007
Mesajlar
2,214
Excel Vers. ve Dili
Office 2013 TR / 32 Bit
Yanıt

Sayfa kod bölümüne yazınız
Kod:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("C3,K5,L8,D9,AA1").Font.Color = [A1].Font.Color
End Sub
 
Katılım
20 Ocak 2007
Mesajlar
230
Excel Vers. ve Dili
Office 2003 TÜRKÇE
Sayfa kod bölümüne yazınız
Kod:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("C3,K5,L8,D9,AA1").Font.Color = [A1].Font.Color
End Sub

Çok teşekkür ederim. Bir sorum daha olacak


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1.H1,L1,M1.Z1,AA1,AC1,AK1,AZ1.BC1").Font.Color = [J1].Font.Color
Range("A2.H2,L2,M2.Z2,AA2,AC2,AK2,AZ2.BC2").Font.Color = [J2].Font.Color
Range("A3.H3,L3,M3.Z3,AA3,AC3,AK3,AZ3.BC3").Font.Color = [J3].Font.Color
Range("A4.H4,L4,M4.Z4,AA4,AC4,AK4,AZ4.BC4").Font.Color = [J4].Font.Color
End Sub


bu kod J365 e kadar sürecek ancak. Tek tek 365 data yazmam çok uzun sürer bu kodu nasıl en kolay hale getirebilirim.

Yani en sonki code Range("A365.H365,L365,M365.Z365,AA365,AC365,AK365,AZ365.BC365").Font.Color = [J365].Font.Color
 

Ayhan Ercan

Özel Üye
Katılım
10 Ağustos 2005
Mesajlar
1,573
Excel Vers. ve Dili
Microsoft 365- Türkçe
belki bu şekilde işinizi görebilir..

Kod:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For i = 1 To 365
Range("A" & i, "h" & i).Font.Color = Range("j" & i).Font.Color
Range("l" & i, "z" & i).Font.Color = Range("j" & i).Font.Color
Range("aa" & i).Font.Color = Range("j" & i).Font.Color
Range("ac" & i).Font.Color = Range("j" & i).Font.Color
Range("ak" & i).Font.Color = Range("j" & i).Font.Color
Range("az" & i, "bc" & i).Font.Color = Range("j" & i).Font.Color
Next
End Sub
 
Katılım
20 Ocak 2007
Mesajlar
230
Excel Vers. ve Dili
Office 2003 TÜRKÇE
belki bu şekilde işinizi görebilir..

Kod:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For i = 1 To 365
Range("A" & i, "h" & i).Font.Color = Range("j" & i).Font.Color
Range("l" & i, "z" & i).Font.Color = Range("j" & i).Font.Color
Range("aa" & i).Font.Color = Range("j" & i).Font.Color
Range("ac" & i).Font.Color = Range("j" & i).Font.Color
Range("ak" & i).Font.Color = Range("j" & i).Font.Color
Range("az" & i, "bc" & i).Font.Color = Range("j" & i).Font.Color
Next
End Sub
Teşekkür Ederim.Deneyeceğim.
 
Üst