Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Clear contents

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Clear contents

Hi Samantha,

Try removing selections from your code.

If this is a problem for you, post your code.


---
Regards,
Norman



"SamanthaK" wrote in message
...
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!



  #3   Report Post  
Posted to microsoft.public.excel.programming
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!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Clear contents

hi,
add this line to your code after the clear contents.
Range("A1").select 'or select another cell
or
Cells(1,1).select

regards
FSt1

"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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear Contents gibbylinks Setting up and Configuration of Excel 5 October 12th 09 05:04 PM
Clear Contents Secret Squirrel Excel Discussion (Misc queries) 1 February 3rd 09 12:37 AM
to clear contents of a spreadsheet Jerry Excel Discussion (Misc queries) 2 August 17th 07 02:20 AM
Clear Contents Help michael Excel Programming 3 June 6th 06 09:42 PM
Clear contents if x is not in the row Mighvik Excel Programming 1 October 5th 04 08:14 PM


All times are GMT +1. The time now is 06:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"