Hi,
I am struggling with vba code which is supposed to do the following:
<tbody>
</tbody>
In the TABLE (not range) I need that row 3 until last row is deleted and that the second row for columns ID:Region that this row is cleared content; column Sales has formula based on the three first columns
I have the following code which is not working:
Sub Test()
Dim loSource As Excel.ListObject
Dim laSource As Excel.ListObject
Set loSource = Sheets("Sales").ListObjects("Table1")
loSource.ListObjects(2).DataBodyRange.Delete Shift:=xlShiftUp
Set laSource = Sheets("Sales").ListObjects("Table1")
laSource.ListColumns.Range("Table1[[ID]:[Region]]").Select
Selection.ClearContents
End Sub
Thank you
I am struggling with vba code which is supposed to do the following:
ID | Employee | Region | Sales |
1 | John | Spain | 10 |
2 | Mike | UK | 20 |
3 | Peter | Germany | 30 |
<tbody>
</tbody>
In the TABLE (not range) I need that row 3 until last row is deleted and that the second row for columns ID:Region that this row is cleared content; column Sales has formula based on the three first columns
I have the following code which is not working:
Sub Test()
Dim loSource As Excel.ListObject
Dim laSource As Excel.ListObject
Set loSource = Sheets("Sales").ListObjects("Table1")
loSource.ListObjects(2).DataBodyRange.Delete Shift:=xlShiftUp
Set laSource = Sheets("Sales").ListObjects("Table1")
laSource.ListColumns.Range("Table1[[ID]:[Region]]").Select
Selection.ClearContents
End Sub
Thank you