Questions and Answers on Excel Macros
Level: Beginner
Topic: What is the difference between "Delete" and "ClearContents"?
Question:
If I have a value of 30 in cell A2 and I use Range("A1").Delete to clear cell A1 the 30 from cell A2 moves up to cell A1.
Answer:
When you use the word Delete, you are sending the cell to Kingdom come and the cell below (by default) take its place. If you just want to empty cell A1 use Range("A1").ClearContents
To learn everything about cells and ranges see lesson 16 of my Tutorial on Excel Macros
To send your questions or comments click here
Back to Q&A on Excel Macros
|