Hi Guys,
I have a problem to this code. whenever I move the data it will paste 22 set of rows to OSRF Tracker ver1 0.xls..instead of only 1 row. the code with the red font is the code im talking about..
Thanks and Regards,Code:Private Sub CommandButton1_Click() Dim i As Integer ' counter Dim results As Integer results = MsgBox("Are you sure you want to Log this record?", vbYesNo, "") If results = vbYes Then Workbooks.Open "C:\Documents and Settings\LimA1\Desktop\OSRF Tracker ver1 0.xls" With Workbooks("OSRF Tracker ver1 0.xls").Sheets("Data") i = .Cells(Rows.Count, "B").End(xlUp).Row + 1 .Range("B2:F2" & i).Value = Workbooks("OSRF(ver3.0).xls").Sheets("Sheet1").Range("D10:H10").Value .Range("G" & i).Value = Workbooks("OSRF(ver3.0).xls").Sheets("Sheet1").Range("I5").Value .Range("I" & i).Value = Workbooks("OSRF(ver3.0).xls").Sheets("Sheet1").Range("E38").Value .Range("J" & i).Value = Workbooks("OSRF(ver3.0).xls").Sheets("Sheet1").DTPicker1.Value .Range("K" & i).Value = Workbooks("OSRF(ver3.0).xls").Sheets("Sheet1").DTPicker2.Value End With End If
kevin




instead of only 1 row. the code with the red font is the code im talking about..
Reply With Quote