• DİKKAT

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

Hücreye Tıklama ile userforma gelen bilgileri güncelleme

Katılım
13 Temmuz 2016
Mesajlar
613
Excel Vers. ve Dili
Excel 2010 & 2016 Türkçe
Arkadaşlar Hayırlı akşamlar
VERİ sayfasında isimlere tıkladığımızda userform üzerindeki textboxlara DATA sayfasından bilgi gelmekte Ancak textbox üzerinde bir değişiklik yaptığımda DATA sayfasında güncelleme yapamıyorum.
 

Ekli dosyalar

Merhaba,

Arşivleme şartını tam olarak anlayamadım.

Onun dışındakiler için:

Sayfadaki kodları aşağıdakiyle değiştirin.

Kod:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

    On Error GoTo hata
   
    If Intersect(Target, [A:A]) Is Nothing Then Exit Sub
    
    With Target
        If .Row < 2 Then Exit Sub
        If .Count > 1 Then Exit Sub
        If .Value = "" Then Exit Sub
        Set c = Sheets("DATA").[A:A].Find(.Value, , xlValues, xlWhole)
        If Not c Is Nothing Then
            sat = c.Row
            UserForm1.Show 0
        End If
    End With

    Cancel = True
hata:

End Sub

Userform1'in kod bölümüne:

Kod:
Dim Sd As Worksheet, Sa As Worksheet

Private Sub CheckBox1_Click()

    If CheckBox1.Value = True Then
        CheckBox1.Caption = "ARŞİVLENDİ"
    Else
        CheckBox1.Caption = "GÜNCEL"
    End If
    
End Sub

Private Sub CommandButton1_Click()
    
    Dim i As Byte
    
    For i = 1 To 5
        Sd.Cells(sat, i) = Controls("TextBox" & i)
    Next i
    Sd.Cells(sat, "B") = CDbl(TextBox2.Text)
    Sd.Cells(sat, "E") = CDate(TextBox5.Text)

    If CheckBox1.Value = True Then
        Sd.OLEObjects("CheckBox" & sat - 1).Object.Value = True
    Else
        Sd.OLEObjects("CheckBox" & sat - 1).Object.Value = False
    End If
    
End Sub

Private Sub UserForm_Initialize()
    
    Dim i As Byte
    
    Set Sd = Sheets("DATA")
    Set Sa = Sheets("ARŞİV")
    
    For i = 1 To 5
        Controls("TextBox" & i) = Sd.Cells(sat, i)
    Next i
    TextBox5.Text = Format(Sd.Cells(sat, "E"), "dd.mm.yyyy")
    
    CheckBox1.Caption = "GÜNCEL"
    If Sd.Cells(sat, "F") = "ARŞİVLENDİ" Then
        CheckBox1.Caption = "ARŞİVLENDİ"
        CheckBox1.Value = True
    End If
    
End Sub


Standart bir module:

Kod:
Public sat As Long

.
 
Geri
Üst