Skip to main content

AccessTr.neT


Şablonu Belirlenen Sayfalara Kopyalama Yöntemi İle Şartlı Dağıtmak

Şablonu Belirlenen Sayfalara Kopyalama Yöntemi İle Şartlı Dağıtmak

#2
Önceki konuda yazdığınız boş satır renk olayı için kodu ayarladım.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim Açýklama_Ekleme As Comment, aa As String
Dim strText, hucre As Range, hucre2 As Range, son As Long

''''''''''''''''''Renk Kodlarý''''''''''''''''''''''''''''''''''
son = ActiveSheet.Range("Aj" & Rows.Count).End(3).Row
If son < 7 Then Exit Sub
On Error GoTo son
If (Target.Column >= 5 And Target.Column <= 35) And (Target.Row > 6 And Target.Row = son) Then

If Target.Value = 0 Then
' Target.Interior.color = 16750848
Target.Interior.color = rgbPink
ElseIf Target.Value = 1 Then
Target.Interior.color = vbWhite
End If
End If
son:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''Açýklama Bilgisi Kodlarý'''''''''

If Target.Row < 6 Then Exit Sub
If Target.Row > son Then Exit Sub
If Target.Column < 6 Then Exit Sub
If Target.Column > 36 Then Exit Sub
If Cells(Target.Row, 2).Value <> "" And Len(Cells(Target.Row, 2).Value + 0) <> 6 Then Exit Sub

Set Açýklama_Ekleme = Target.Comment
If Not Açýklama_Ekleme Is Nothing Then
strText = Application.InputBox("Eklenecek olan mesajý aþaðýya yazýnýz.", "Açýklama_Ekleme", Target.Comment.text, , , , 2)
Else
strText = Application.InputBox("Eklenecek olan mesajý aþaðýya yazýnýz.", "Açýklama_Ekleme", "Açýklama Ekler", , , , 2)
End If

If strText = False Then Exit Sub
'Eger inputbox bossa
If strText = "" Then
'eger inputbox bossa ve msaj kuutundan evet secilirse
If MsgBox("Secilen aciklamalar silinsin mi?", vbQuestion + vbYesNo) = vbYes Then
'eger tek hücre secilmisse
If Target.Cells.Count = 1 Then
sil Target
'eger birden fazla hücre secilmisse
Else
For Each hucre2 In Selection
sil hucre2
Next
End If
End If
'eger inputbox bos degilse
Else
'eger tek hücre secilmisse
If Target.Cells.Count = 1 Then
ekle Target, strText
'eger birden fazla hücre secilmisse
Else
For Each hucre2 In Selection
ekle hucre2, strText
Next
End If
End If

End Sub
Cevapla

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

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
RE: Şablonu Belirlenen Sayfalara Kopyalama Yöntemi İle Şartlı Dağıtmak - Yazar: feraz - 21/11/2020, 20:44