• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Cetvel Makrosunda satır seçmek

Katılım
14 Kasım 2021
Mesajlar
42
Excel Vers. ve Dili
Excell 2010 Türkçe
Merhaba aşağıda bulunan koda ekleme yapabilirmiyim ilk 5 satırda çalışmaması için sağdan sola soldan sağa seçebiliyorum istediğim aralığı en üst 5 satır problem oluyor varmıdır bir kodu



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Application.ScreenUpdating = False
If Application.CutCopyMode = xlCopy Then Exit Sub
If Application.CutCopyMode = xlCut Then Exit Sub
Cells.FormatConditions.Delete
Range("A87") = 1
With Range("B" & Target.Row).Resize(1, 19)
.FormatConditions.Add xlExpression, , "=$A$87=1"
.FormatConditions(1).Borders.LineStyle = 0
.FormatConditions(1).Interior.ColorIndex = 8
.FormatConditions(1).Font.Bold = True
.FormatConditions(1).Font.Colorlndex = 5
End With
Range("A:S").FormatConditions.Add xlExpression, , "=$A1<>"""""
Range("A:s").FormatConditions(2).Borders.LineSty1e = 0
Application.ScreenUpdating = True
End Sub
 

ÖmerFaruk

Destek Ekibi
Destek Ekibi
Katılım
22 Ekim 2017
Mesajlar
4,882
Excel Vers. ve Dili
Microsoft 365 Tr-64
C++:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Row < 6 Then Exit Sub ' Bu satırı kodların en başına ekleyebilirsiniz.
    On Error Resume Next
    Application.ScreenUpdating = False
    If Application.CutCopyMode = xlCopy Then Exit Sub
    If Application.CutCopyMode = xlCut Then Exit Sub
    Cells.FormatConditions.Delete
    Range("A87") = 1
    With Range("B" & Target.Row).Resize(1, 19)
        .FormatConditions.Add xlExpression, , "=$A$87=1"
        .FormatConditions(1).Borders.LineStyle = 0
        .FormatConditions(1).Interior.ColorIndex = 8
        .FormatConditions(1).Font.Bold = True
        .FormatConditions(1).Font.Colorlndex = 5
    End With
    Range("A:S").FormatConditions.Add xlExpression, , "=$A1<>"""""
    Range("A:s").FormatConditions(2).Borders.LineSty1e = 0
    Application.ScreenUpdating = True
End Sub
 
Katılım
14 Kasım 2021
Mesajlar
42
Excel Vers. ve Dili
Excell 2010 Türkçe
C++:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Row < 6 Then Exit Sub ' Bu satırı kodların en başına ekleyebilirsiniz.
    On Error Resume Next
    Application.ScreenUpdating = False
    If Application.CutCopyMode = xlCopy Then Exit Sub
    If Application.CutCopyMode = xlCut Then Exit Sub
    Cells.FormatConditions.Delete
    Range("A87") = 1
    With Range("B" & Target.Row).Resize(1, 19)
        .FormatConditions.Add xlExpression, , "=$A$87=1"
        .FormatConditions(1).Borders.LineStyle = 0
        .FormatConditions(1).Interior.ColorIndex = 8
        .FormatConditions(1).Font.Bold = True
        .FormatConditions(1).Font.Colorlndex = 5
    End With
    Range("A:S").FormatConditions.Add xlExpression, , "=$A1<>"""""
    Range("A:s").FormatConditions(2).Borders.LineSty1e = 0
    Application.ScreenUpdating = True
End Sub[

Çok teşekkür ederim
 
Üst