I am a bit of a VBA novice so was hoping someone could help with the following. I need to select (and clear the contents of) all cells in a workbook before pasting new data in. Problem is when I use the (xlToLeft) command it stops when it encounters an empty cell.
I have the code below (which works) but wanted to see if there is a better way, which I am sure there will be.
Sheets("TEST").Activate
Range("BB3").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.ClearContents
Just for reference I have info in the cells to the right which I want to keep and the rows will change on each occasion I run the script.