its working fine with ms offce 2003, but when i try it with office 2010, it gives error:
run time error 9: script out of range?
vb code is :::::
Private Sub CommandButton1_Click()
Dim i As Long, j As Long
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) Then
j = j + 1
Worksheets("Sheet1").Range("A" & i + 2).Resize(1, 6).Copy Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next i
MsgBox j & " Rows Copied To Sheet 2 - Have a look if you dont beleive me"
End Sub
Private Sub UserForm_Initialize()
With Worksheets("Sheet1")
Me.ListBox1.RowSource = .Range("A2", .Range("A" & Rows.Count).End(xlUp).Offset(1, 6)).Address(External:=True)
End With
End Sub
Please help me !!!!!!
Bookmarks