Pak Hendrik dan Pak Zainul, Terima kasih banyak untuk bantuannya, Sudah Solved.
On Mon, Aug 5, 2019 at 11:48 PM Zainul Ulum zainul_u...@yahoo.com [belajar-excel] <belajar-excel@yahoogroups.com> wrote: > > > Stephen, > > > > Coba ganti di nilai di variable rc memnjadi : > > > > rc= Sheets(1).Range("A10000").end(xlup).row ’asumsi maksimal > baris/record=10000 > > > > Thanks, > > -zainul > > > > > > Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for > Windows 10 > > > > *From: *Stephen Saputro stephensapu...@gmail.com [belajar-excel] > <belajar-excel@yahoogroups.com> > *Sent: *Monday, August 5, 2019 4:47 PM > *To: *belajar-excel@yahoogroups.com > *Subject: *[belajar-excel] Kirim data ke excel lain menggunakan VBA > > > > > > Selamat sore semuanya, > > > > Mohon kiranya dapat di bantu kasus saya ini. Saya membuat sebuah database > sederhana, di mana ada satu workbook yang saya gunakan sebagai Table > master. dan satu lagi worbook excel yang saya gunakan untuk mengirimkan > data ke table master dengan menggunakan VBA. > > > > Permasalahan nya adalah script yang saya pakai di bawah ini, terkadang > mengirimkan data dengan baik ke data row paling akhir dari sebuah table > master, tapi terkadang data tersebut malah menimpa data lain yang sudah ada > dengan row yang berbeda ( data yang masuk ke kolom2 nya sudah tepat hanya > saja row nya yang berbeda, seharus nya adalah konsisten di row data sesudah > row terakhir ) > > > > Script nya adalah sbb : > > > > Private Sub Kirimdata_Click() > > If TextBox1.Value = "" Or TextBox4..Value = "" Then > If MsgBox("Form is not complete.. Please fill the data No and the > amount !", vbQuestion + vbYesNo) <> yes Then > Exit Sub > End If > End If > > > Dim rc As Long > Dim path As String > Dim wb As Workbook > > Application.ScreenUpdating = False > path = "\\blabla\blabla\blabla\master.xlsm" > rc = ActiveSheet.UsedRange.Rows.Count > > Workbooks.Open " \\blabla\blabla\blabla\master.xlsm " > Set wb = ActiveWorkbook > rc = ActiveSheet.UsedRange.Rows.Count > > With Sheets(1).Range("A1") > .Offset(rc, 0).Value = Me.ListBox1.Value > .Offset(rc, 1).Value = Me.ListBox2.Value > .Offset(rc, 2)..Value = Me.ListBox3..Value > .Offset(rc, 3).Value = Me.ListBox4.Value > .Offset(rc, 4).Value = Me.ListBox5.Value > .Offset(rc, 5).Value = Me..TextBox1.Value > .Offset(rc, 6).Value = Me.TextBox2.Value > .Offset(rc, 7).Value = Me.TextBox3.Value > .Offset(rc, 8).Value = Me.ListBox6..Value > .Offset(rc, 9).Value = Me.TextBox5.Value > .Offset(rc, 10).Value = Me.TextBox4.Value > .Offset(rc, 11)...Value = Me.TextBox7.Value > ..Offset(rc, 12).Value = Me.TextBox8.Value > .Offset(rc, 13).Value = Me..ListBox7.Value > .Offset(rc, 14).Value = Me.TextBox6.Value > > > End With > > wb.Save > wb.Close > Application.ScreenUpdating = True > Unload Me > Inputdata.Show > End Sub > > > > Terima kasih sekali lagi untuk bantuan nya > > > > > > >