Thread: Clear contents
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] aidan.heritage@virgin.net is offline
external usenet poster
 
Posts: 244
Default Clear contents

You haven't quoted any of your code, but I'm guessing you've got a
range.select or cells.select in there somewhere so that your code is
something like

Cells.Select
Selection.ClearContents


(which is exactly what you would get if you recorded the macro)

try

Cells.ClearContents

I think you will find this fixes it!



SamanthaK wrote:
I am writing macro that clears the contents of a spreadsheet. After this is
done the whole spreadsheet is selected (it is blue...). How do I write code
so that the spreadsheet is not selected after clear contents is done?
--
I am very thankful for any fast assistance!