This is Table3 in the Sheet Receipt. The first two columns are needed to be copied and their values are to be pasted in...
Table9 in Sheet IndividualProfitLoss.
Now Table9 is cleared by a code in VBA which is the following :
VBA Code:
Private Sub CommandButton2_Click() 'ActiveX button's click event handler
Dim lo As ListObject, TABLE_NAME, arr
For Each TABLE_NAME In Array("IndividualProfitLoss|Table9") 'and so on
On Error Resume Next
arr = Split(TABLE_NAME, "|")
Set lo = Me.Parent.Sheets(arr(0)).ListObjects(arr(1))
If Err.Number <> 0 Then
MsgBox TABLE_NAME & " was not found. Check the table name", vbCritical + vbOKOnly, "Sub CommandButton1_Click()"
Exit Sub
End If
On Error GoTo 0
If Not lo.DataBodyRange Is Nothing Then lo.DataBodyRange.Delete
Next
End Sub
I just need help with copying and pasting the value of the first two columns of Table3 into the first two columns of Table9.
Any help would be appreciated.