hi experts
I face the problem of replacing data when copying it from the list box on the userform to the worksheet. What I want it is when copying the data from the list box deleting the old data in the sheet and replacing it with the new data. Rather, replacing the data when copying from listbox to sheet . by the way if you need knowing range in sheet . it starts from column A : J and the headers from row1 .
I try with this
Range("A2").CurrentRegion.ClearContents
this doesn't work
this is the whole code
Private Sub CommandButton1_Click()
Dim r, c As Long
For r = 0 To ListBox1.ListCount - 1
For c = 0 To ListBox1.ColumnCount - 1
'Range("A2").CurrentRegion.ClearContents
Range("A2").Offset(r, c).Value = ListBox1.List(r, c)
Next
Next
End Sub
thanks