- Katılım
- 13 Ekim 2004
- Mesajlar
- 16,058
- Excel Vers. ve Dili
-
Excel 2010-32 bit-Türkçe
Excel 365 -32 bit-Türkçe
Sn Hikmet bey Yukarıdaki mesajımı düzeltiyorum, Userformun kod sayfasındaki tüm kodları silin ve aşağıdakileri yerine kopyalayın.
Kod:
Private Sub UserForm_Initialize()
son1 = [veritabani!c65536].End(3).Row
son2 = WorksheetFunction.CountA([yedek!b:b])
ListBox2.RowSource = ""
ListBox1.RowSource = ""
If son1 > 1 Then ListBox1.RowSource = "veritabani!c2:c" & son1
If son2 > 0 Then ListBox2.RowSource = "yedek!b1:b" & son2
End Sub
Private Sub ListBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer _
, ByVal X As Single, ByVal Y As Single)
If Button = 1 Then
Set veri = New DataObject
efekt = veri.StartDrag
End If
End Sub
Private Sub ListBox2_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
Cancel = True
Effect = fmDropEffectMove
End Sub
Private Sub ListBox2_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, _
ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, _
ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
Cancel = True
Effect = fmDropEffectMove
Set s1 = Sheets("veritabani")
Set s2 = Sheets("yedek")
sat = ListBox1.ListIndex + 2
sonsat = WorksheetFunction.CountA(s2.[a:a]) + 1
ListBox1.RowSource = ""
ListBox2.RowSource = ""
s1.Range("b" & sat & ":z" & sat).Cut s2.Range("a" & sonsat)
s1.Range("b" & sat & ":z" & sat).Delete
s1.[a65536].End(3).ClearContents
UserForm_Initialize
End Sub